Unverified Commit 66832b57 authored by Alexander Færøy's avatar Alexander Færøy
Browse files

WIP: DTrace support.

parent 44aa1adf
Pipeline #15888744 failed with stage
in 6 minutes and 29 seconds
......@@ -128,6 +128,7 @@ uptime-*.json
/src/Makefile.in
# /src/trace
/src/trace/dtrace_probes.h
/src/trace/libor-trace.a
# /src/common/
......
......@@ -218,6 +218,21 @@ if test "x$enable_android" = "xyes"; then
fi
dnl Enable DTrace support.
AC_ARG_ENABLE(dtrace,
AS_HELP_STRING(--enable-dtrace, [build with DTrace support]))
AM_CONDITIONAL([USE_DTRACE], [test "x$enable_dtrace" = "xyes"])
if test "x$enable_dtrace" = "xyes"; then
AC_CHECK_PROGS(DTRACE, dtrace)
if test "x$DTRACE" = "xno"; then
AC_MSG_ERROR([dtrace not found.])
fi
AC_DEFINE([HAVE_DTRACE], 1, [have DTrace])
fi
dnl check for the correct "ar" when cross-compiling.
dnl (AM_PROG_AR was new in automake 1.11.2, which we do not yet require,
dnl so kludge up a replacement for the case where it isn't there yet.)
......
......@@ -77,6 +77,7 @@
#include "routerlist.h"
#include "routerparse.h"
#include "shared_random.h"
#include "trace/dtrace.h"
#ifndef _WIN32
#include <pwd.h>
......@@ -6978,6 +6979,12 @@ control_event_bootstrap(bootstrap_status_t status, int progress)
loglevel = LOG_INFO;
}
if (TOR_BOOTSTRAP_STATUS_ENABLED()) {
// LCOV_EXCL_START
TOR_BOOTSTRAP_STATUS(progress ? progress : status);
// LCOV_EXCL_START
}
tor_log(loglevel, LD_CONTROL,
"Bootstrapped %d%%: %s", progress ? progress : status, summary);
tor_snprintf(buf, sizeof(buf),
......
/* Copyright (c) 2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file dtrace.h
* \brief Header file for DTrace support.
**/
#ifndef TOR_TRACE_DTRACE_H
#define TOR_TRACE_DTRACE_H
#include "trace/dtrace_probes.h"
#endif // TOR_TRACE_DTRACE_H.
/* Copyright (c) 2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
provider tor {
probe bootstrap__status(int);
};
......@@ -16,6 +16,15 @@ TRACEHEADERS += \
src/trace/debug.h
endif
if USE_DTRACE
src/trace/dtrace_probes.h: src/trace/dtrace_probes.d
$(AM_V_GEN)$(DTRACE) -C -h -s $< -o $@
TRACEHEADERS += \
src/trace/dtrace_probes.h \
src/trace/dtrace.h
endif
# Library source files.
src_trace_libor_trace_a_SOURCES = $(LIBOR_TRACE_A_SOURCES)
......
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