Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e31f0d01 authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Add build option NO_AUXTRACE to exclude AUX area tracing



Add build option NO_AUXTRACE to exclude compiling support for AUX area
tracing. Support for both recording and processing is excluded and by
implication any future additions such as Intel PT and Intel BTS will
also not be compiled in with this option.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1430404667-10593-5-git-send-email-adrian.hunter@intel.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent cd10b289
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -73,6 +73,8 @@ include config/utilities.mak
# for CTF data format.
# for CTF data format.
#
#
# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
#
# Define NO_AUXTRACE if you do not want AUX area tracing support


ifeq ($(srctree),)
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
+34 −19
Original line number Original line Diff line number Diff line
@@ -53,25 +53,6 @@ static int output_bytes(struct perf_inject *inject, void *buf, size_t sz)
	return 0;
	return 0;
}
}


static int copy_bytes(struct perf_inject *inject, int fd, off_t size)
{
	char buf[4096];
	ssize_t ssz;
	int ret;

	while (size > 0) {
		ssz = read(fd, buf, min(size, (off_t)sizeof(buf)));
		if (ssz < 0)
			return -errno;
		ret = output_bytes(inject, buf, ssz);
		if (ret)
			return ret;
		size -= ssz;
	}

	return 0;
}

static int perf_event__repipe_synth(struct perf_tool *tool,
static int perf_event__repipe_synth(struct perf_tool *tool,
				    union perf_event *event)
				    union perf_event *event)
{
{
@@ -114,6 +95,27 @@ static int perf_event__repipe_attr(struct perf_tool *tool,
	return perf_event__repipe_synth(tool, event);
	return perf_event__repipe_synth(tool, event);
}
}


#ifdef HAVE_AUXTRACE_SUPPORT

static int copy_bytes(struct perf_inject *inject, int fd, off_t size)
{
	char buf[4096];
	ssize_t ssz;
	int ret;

	while (size > 0) {
		ssz = read(fd, buf, min(size, (off_t)sizeof(buf)));
		if (ssz < 0)
			return -errno;
		ret = output_bytes(inject, buf, ssz);
		if (ret)
			return ret;
		size -= ssz;
	}

	return 0;
}

static s64 perf_event__repipe_auxtrace(struct perf_tool *tool,
static s64 perf_event__repipe_auxtrace(struct perf_tool *tool,
				       union perf_event *event,
				       union perf_event *event,
				       struct perf_session *session
				       struct perf_session *session
@@ -153,6 +155,19 @@ static s64 perf_event__repipe_auxtrace(struct perf_tool *tool,
	return event->auxtrace.size;
	return event->auxtrace.size;
}
}


#else

static s64
perf_event__repipe_auxtrace(struct perf_tool *tool __maybe_unused,
			    union perf_event *event __maybe_unused,
			    struct perf_session *session __maybe_unused)
{
	pr_err("AUX area tracing not supported\n");
	return -EINVAL;
}

#endif

static int perf_event__repipe(struct perf_tool *tool,
static int perf_event__repipe(struct perf_tool *tool,
			      union perf_event *event,
			      union perf_event *event,
			      struct perf_sample *sample __maybe_unused,
			      struct perf_sample *sample __maybe_unused,
+13 −0
Original line number Original line Diff line number Diff line
@@ -112,6 +112,8 @@ static int record__mmap_read(struct record *rec, int idx)
	return rc;
	return rc;
}
}


#ifdef HAVE_AUXTRACE_SUPPORT

static int record__process_auxtrace(struct perf_tool *tool,
static int record__process_auxtrace(struct perf_tool *tool,
				    union perf_event *event, void *data1,
				    union perf_event *event, void *data1,
				    size_t len1, void *data2, size_t len2)
				    size_t len1, void *data2, size_t len2)
@@ -165,6 +167,17 @@ static int record__auxtrace_mmap_read(struct record *rec,
	return 0;
	return 0;
}
}


#else

static inline
int record__auxtrace_mmap_read(struct record *rec __maybe_unused,
			       struct auxtrace_mmap *mm __maybe_unused)
{
	return 0;
}

#endif

static volatile int done = 0;
static volatile int done = 0;
static volatile int signr = -1;
static volatile int signr = -1;
static volatile int child_finished = 0;
static volatile int child_finished = 0;
+5 −0
Original line number Original line Diff line number Diff line
@@ -610,6 +610,11 @@ ifdef LIBBABELTRACE
  endif
  endif
endif
endif


ifndef NO_AUXTRACE
  $(call detected,CONFIG_AUXTRACE)
  CFLAGS += -DHAVE_AUXTRACE_SUPPORT
endif

# Among the variables below, these:
# Among the variables below, these:
#   perfexecdir
#   perfexecdir
#   template_dir
#   template_dir
+3 −1
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ make_no_backtrace := NO_BACKTRACE=1
make_no_libnuma     := NO_LIBNUMA=1
make_no_libnuma     := NO_LIBNUMA=1
make_no_libaudit    := NO_LIBAUDIT=1
make_no_libaudit    := NO_LIBAUDIT=1
make_no_libbionic   := NO_LIBBIONIC=1
make_no_libbionic   := NO_LIBBIONIC=1
make_no_auxtrace    := NO_AUXTRACE=1
make_tags           := tags
make_tags           := tags
make_cscope         := cscope
make_cscope         := cscope
make_help           := help
make_help           := help
@@ -52,7 +53,7 @@ make_static := LDFLAGS=-static
make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
make_minimal        += NO_LIBDW_DWARF_UNWIND=1
make_minimal        += NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1


# $(run) contains all available tests
# $(run) contains all available tests
run := make_pure
run := make_pure
@@ -74,6 +75,7 @@ run += make_no_backtrace
run += make_no_libnuma
run += make_no_libnuma
run += make_no_libaudit
run += make_no_libaudit
run += make_no_libbionic
run += make_no_libbionic
run += make_no_auxtrace
run += make_help
run += make_help
run += make_doc
run += make_doc
run += make_perf_o
run += make_perf_o
Loading