Commit 6caf56e5 authored by Abhishek Arya's avatar Abhishek Arya Committed by Commit Bot

Disable excessive logging in profiling fuzzer.

R=mmoroz@chromium.org
TBR=erikchen@chromium.org

Bug: 900812
Change-Id: I1e7cac38d9d705179aeff95d438a6932febe8cd4
Reviewed-on: https://chromium-review.googlesource.com/c/1317868Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605522}
parent 0584077e
......@@ -74,6 +74,7 @@ fuzzer_test("profiling_fuzzer") {
]
deps = [
":heap_profiling",
"//base",
]
libfuzzer_options = [ "max_len = 64000" ]
dict = "stream_fuzzer.dict"
......
......@@ -2,11 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/logging.h"
#include "components/services/heap_profiling/receiver.h"
#include "components/services/heap_profiling/stream_parser.h"
#include <utility>
struct Environment {
Environment() {
// Disable noisy logging as per "libFuzzer in Chrome" documentation:
// testing/libfuzzer/getting_started.md#Disable-noisy-error-message-logging.
logging::SetMinLogLevel(logging::LOG_FATAL);
}
};
namespace heap_profiling {
namespace {
......@@ -27,6 +36,9 @@ class DummyReceiver : public Receiver {
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Initialize environment once.
static Environment env;
heap_profiling::DummyReceiver receiver;
scoped_refptr<heap_profiling::StreamParser> parser(
new heap_profiling::StreamParser(&receiver));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment