Bug 1530773 - Add log module and macro for fuzzing. r=froydnj
☠☠ backed out by a1d16d17e6eb ☠ ☠
authorChristian Holler <choller@mozilla.com>
Tue, 26 Feb 2019 21:10:02 +0000
changeset 519274 2a034c02b842f00f2bad8e6a1894da33cd21def9
parent 519273 2bb574d4377e1d7f40d247519cac8fc586aecf19
child 519275 ae89133ff9bd067f8b7d1d619f3c85bd5659fb2c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1530773
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530773 - Add log module and macro for fuzzing. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D21251
tools/fuzzing/interface/FuzzingInterface.cpp
tools/fuzzing/interface/FuzzingInterface.h
tools/fuzzing/interface/moz.build
new file mode 100644
--- /dev/null
+++ b/tools/fuzzing/interface/FuzzingInterface.cpp
@@ -0,0 +1,16 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/*
+ * Common code for the unified fuzzing interface
+ */
+
+#include "FuzzingInterface.h"
+
+namespace mozilla {
+
+LazyLogModule gFuzzingLog("nsFuzzing");
+
+} // namespace mozilla
--- a/tools/fuzzing/interface/FuzzingInterface.h
+++ b/tools/fuzzing/interface/FuzzingInterface.h
@@ -9,19 +9,25 @@
 
 #ifndef FuzzingInterface_h__
 #define FuzzingInterface_h__
 
 #include <fstream>
 
 #include "FuzzerRegistry.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/Logging.h"
 
 namespace mozilla {
 
+extern LazyLogModule gFuzzingLog;
+
+#define FUZZING_LOG(args) \
+  MOZ_LOG(mozilla::gFuzzingLog, mozilla::LogLevel::Verbose, args)
+
 typedef int (*FuzzingTestFuncRaw)(const uint8_t*, size_t);
 
 #ifdef __AFL_COMPILER
 
 static int afl_interface_raw(const char* testFile,
                              FuzzingTestFuncRaw testFunc) {
   char* buf = NULL;
 
--- a/tools/fuzzing/interface/moz.build
+++ b/tools/fuzzing/interface/moz.build
@@ -5,16 +5,20 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 Library('fuzzer-interface')
 
 EXPORTS += [
     'FuzzingInterface.h',
 ]
 
+SOURCES += [
+    'FuzzingInterface.cpp',
+]
+
 if CONFIG['JS_STANDALONE']:
     FINAL_LIBRARY = "js"
 else:
     EXPORTS += [
         'FuzzingInterfaceStream.h',
     ]
 
     SOURCES += [