Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490196 > unrolled thread

[PATCH 00/16] perf tools: Add support for using symbols in address filters

Started byAdrian Hunter <adrian.hunter@intel.com>
First post2016-09-23 16:50 +0200
Last post2016-09-29 20:20 +0200
Articles 14 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/16] perf tools: Add support for using symbols in address filters Adrian Hunter <adrian.hunter@intel.com> - 2016-09-23 16:50 +0200
    [PATCH 06/16] perf symbols: Add dso__last_symbol() Adrian Hunter <adrian.hunter@intel.com> - 2016-09-23 16:50 +0200
      [tip:perf/core] perf symbols: Add dso__last_symbol() tip-bot for Adrian Hunter <tipbot@zytor.com> - 2016-09-29 20:20 +0200
    [PATCH 02/16] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change Adrian Hunter <adrian.hunter@intel.com> - 2016-09-23 16:50 +0200
      [tip:perf/core] perf tools: Fix MMAP event synthesis broken by  MAP_HUGETLB change tip-bot for Adrian Hunter <tipbot@zytor.com> - 2016-09-29 20:20 +0200
    [PATCH 10/16] perf intel-pt: Add support for recording the max non-turbo ratio Adrian Hunter <adrian.hunter@intel.com> - 2016-09-23 16:50 +0200
      [tip:perf/core] perf intel-pt: Add support for recording the max  non-turbo ratio tip-bot for Adrian Hunter <tipbot@zytor.com> - 2016-09-29 20:20 +0200
    [PATCH 08/16] perf tools: Increase debug level of SDT debug messages Adrian Hunter <adrian.hunter@intel.com> - 2016-09-23 16:50 +0200
      Re: [PATCH 08/16] perf tools: Increase debug level of SDT debug  messages Masami Hiramatsu <mhiramat@kernel.org> - 2016-09-24 02:20 +0200
        Re: [PATCH 08/16] perf tools: Increase debug level of SDT debug  messages Adrian Hunter <adrian.hunter@intel.com> - 2016-09-26 09:40 +0200
          Re: [PATCH 08/16] perf tools: Increase debug level of SDT debug  messages Masami Hiramatsu <mhiramat@kernel.org> - 2016-09-27 19:50 +0200
      [tip:perf/core] perf probe: Increase debug level of SDT debug  messages tip-bot for Adrian Hunter <tipbot@zytor.com> - 2016-09-29 20:20 +0200
    [PATCH 11/16] perf intel-pt: Fix missing error codes processing auxtrace_info Adrian Hunter <adrian.hunter@intel.com> - 2016-09-23 16:50 +0200
      [tip:perf/core] perf intel-pt: Fix missing error codes processing  auxtrace_info tip-bot for Adrian Hunter <tipbot@zytor.com> - 2016-09-29 20:20 +0200

#1490196 — [PATCH 00/16] perf tools: Add support for using symbols in address filters

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-23 16:50 +0200
Subject[PATCH 00/16] perf tools: Add support for using symbols in address filters
Message-ID<skzXz-53e-3@gated-at.bofh.it>
Hi

Here are some patches that add support for using symbols in address
filters.  There are also some fixes for other things that I came across
during testing.

Finally there are patches for Intel PT, mainly to fix an issue with address
filters, but also these two:
      perf intel-pt: Fix snapshot overlap detection decoder errors
      perf intel-pt: Add support for recording the max non-turbo ratio

The patches are on top of Mathieu's patches:
	perf tools: adding support for address filters
	perf tools: new tracepoint specific function
	perf tools: making perf_evsel__append_filter() generic


Adrian Hunter (16):
      perf record: Fix documentation 'event_sources' -> 'event_source'
      perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
      perf script: Fix vanished idle symbols
      perf record: Rename label 'out_symbol_exit'
      perf record: Fix error paths
      perf symbols: Add dso__last_symbol()
      perf record: Add support for using symbols in address filters
      perf tools: Increase debug level of SDT debug messages
      perf intel-pt: Fix snapshot overlap detection decoder errors
      perf intel-pt: Add support for recording the max non-turbo ratio
      perf intel-pt: Fix missing error codes processing auxtrace_info
      perf intel-pt: Add a helper function for processing AUXTRACE_INFO
      perf intel-pt: Record address filter in AUXTRACE_INFO event
      perf intel-pt: Read address filter from AUXTRACE_INFO event
      perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
      perf intel-pt: Fix decoding when there are address filters

 tools/perf/Documentation/perf-record.txt           |  61 +-
 tools/perf/arch/x86/util/intel-pt.c                |  57 +-
 tools/perf/builtin-record.c                        |  32 +-
 tools/perf/util/auxtrace.c                         | 737 +++++++++++++++++++++
 tools/perf/util/auxtrace.h                         |  54 ++
 tools/perf/util/build-id.c                         |   4 +-
 tools/perf/util/event.c                            |   3 +-
 tools/perf/util/evsel_fprintf.c                    |   7 +-
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |  30 +
 .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |   1 +
 tools/perf/util/intel-pt.c                         | 172 ++++-
 tools/perf/util/intel-pt.h                         |   4 +-
 tools/perf/util/probe-file.c                       |   2 +-
 tools/perf/util/symbol.c                           |  15 +
 tools/perf/util/symbol.h                           |   1 +
 15 files changed, 1143 insertions(+), 37 deletions(-)


Regards
Adrian

[toc] | [next] | [standalone]


#1490197 — [PATCH 06/16] perf symbols: Add dso__last_symbol()

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-23 16:50 +0200
Subject[PATCH 06/16] perf symbols: Add dso__last_symbol()
Message-ID<skzXA-53e-37@gated-at.bofh.it>
In reply to#1490196
Add a function to find the last symbol in a DSO. This will be used when
parsing address filters to calculate a region that includes the entire DSO.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/symbol.c | 15 +++++++++++++++
 tools/perf/util/symbol.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 19c9c558454f..aecff69a510d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -345,6 +345,16 @@ static struct symbol *symbols__first(struct rb_root *symbols)
 	return NULL;
 }
 
+static struct symbol *symbols__last(struct rb_root *symbols)
+{
+	struct rb_node *n = rb_last(symbols);
+
+	if (n)
+		return rb_entry(n, struct symbol, rb_node);
+
+	return NULL;
+}
+
 static struct symbol *symbols__next(struct symbol *sym)
 {
 	struct rb_node *n = rb_next(&sym->rb_node);
@@ -466,6 +476,11 @@ struct symbol *dso__first_symbol(struct dso *dso, enum map_type type)
 	return symbols__first(&dso->symbols[type]);
 }
 
+struct symbol *dso__last_symbol(struct dso *dso, enum map_type type)
+{
+	return symbols__last(&dso->symbols[type]);
+}
+
 struct symbol *dso__next_symbol(struct symbol *sym)
 {
 	return symbols__next(sym);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 0dacfb7d5b67..d964844eb314 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -259,6 +259,7 @@ struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
 struct symbol *symbol__next_by_name(struct symbol *sym);
 
 struct symbol *dso__first_symbol(struct dso *dso, enum map_type type);
+struct symbol *dso__last_symbol(struct dso *dso, enum map_type type);
 struct symbol *dso__next_symbol(struct symbol *sym);
 
 enum dso_type dso__type_fd(int fd);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1493650 — [tip:perf/core] perf symbols: Add dso__last_symbol()

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2016-09-29 20:20 +0200
Subject[tip:perf/core] perf symbols: Add dso__last_symbol()
Message-ID<smO66-7D0-49@gated-at.bofh.it>
In reply to#1490197
Commit-ID:  cd67f99fe90dcf515f1c70c474b84d56b6236cbb
Gitweb:     http://git.kernel.org/tip/cd67f99fe90dcf515f1c70c474b84d56b6236cbb
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 23 Sep 2016 17:38:38 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 29 Sep 2016 11:17:01 -0300

perf symbols: Add dso__last_symbol()

Add a function to find the last symbol in a DSO. This will be used when
parsing address filters to calculate a region that includes the entire
DSO.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c | 15 +++++++++++++++
 tools/perf/util/symbol.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 19c9c55..aecff69 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -345,6 +345,16 @@ static struct symbol *symbols__first(struct rb_root *symbols)
 	return NULL;
 }
 
+static struct symbol *symbols__last(struct rb_root *symbols)
+{
+	struct rb_node *n = rb_last(symbols);
+
+	if (n)
+		return rb_entry(n, struct symbol, rb_node);
+
+	return NULL;
+}
+
 static struct symbol *symbols__next(struct symbol *sym)
 {
 	struct rb_node *n = rb_next(&sym->rb_node);
@@ -466,6 +476,11 @@ struct symbol *dso__first_symbol(struct dso *dso, enum map_type type)
 	return symbols__first(&dso->symbols[type]);
 }
 
+struct symbol *dso__last_symbol(struct dso *dso, enum map_type type)
+{
+	return symbols__last(&dso->symbols[type]);
+}
+
 struct symbol *dso__next_symbol(struct symbol *sym)
 {
 	return symbols__next(sym);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 0dacfb7..d964844 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -259,6 +259,7 @@ struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
 struct symbol *symbol__next_by_name(struct symbol *sym);
 
 struct symbol *dso__first_symbol(struct dso *dso, enum map_type type);
+struct symbol *dso__last_symbol(struct dso *dso, enum map_type type);
 struct symbol *dso__next_symbol(struct symbol *sym);
 
 enum dso_type dso__type_fd(int fd);

[toc] | [prev] | [next] | [standalone]


#1490198 — [PATCH 02/16] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-23 16:50 +0200
Subject[PATCH 02/16] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
Message-ID<skzXA-53e-53@gated-at.bofh.it>
In reply to#1490196
Patch "perf record: Mark MAP_HUGETLB when synthesizing mmap events") breaks
MMAP event synthesis.  The executable name comparison will match any name
if the length is zero, resulting in all the user space maps becoming
anonymous.  This is particularly noticeable with system-wide traces.
Example:

	perf record -a sleep 1
	perf script --show-mmap-events

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2880e2226fdb..8ab0d7da956b 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -346,7 +346,8 @@ out:
 		if (!strcmp(execname, ""))
 			strcpy(execname, anonstr);
 
-		if (!strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
+		if (hugetlbfs_mnt_len &&
+		    !strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
 			strcpy(execname, anonstr);
 			event->mmap2.flags |= MAP_HUGETLB;
 		}
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1493651 — [tip:perf/core] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2016-09-29 20:20 +0200
Subject[tip:perf/core] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
Message-ID<smO66-7D0-33@gated-at.bofh.it>
In reply to#1490198
Commit-ID:  973186ca7fe94d770a9847d7d530864de6ab638b
Gitweb:     http://git.kernel.org/tip/973186ca7fe94d770a9847d7d530864de6ab638b
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 23 Sep 2016 17:38:34 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 28 Sep 2016 10:21:15 -0300

perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change

Patch "perf record: Mark MAP_HUGETLB when synthesizing mmap events") breaks
MMAP event synthesis.  The executable name comparison will match any name
if the length is zero, resulting in all the user space maps becoming
anonymous.  This is particularly noticeable with system-wide traces.
Example:

	perf record -a sleep 1
	perf script --show-mmap-events

Committer note:

That is not the case when, say, one has a qemu instance and libvirt actually
mounts hugetlbfs. To test this I had to first umount it:

[root@jouet ~]# mount | grep hugetlbfs
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)
[root@jouet ~]#

After unmount it the error fixed by this patch manifests itself:

  # perf record -a sleep 1
  # perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp //anon
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp //anon
  #

Fixed version:

  # perf record -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.419 MB perf.data (182 samples) ]
  # perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp /usr/lib/systemd/systemd
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp /usr/lib64/libuuid.so.1.3.0
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp /usr/lib64/libblkid.so.1.1.0
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp /usr/lib64/libz.so.1.2.8
    systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp /usr/lib64/liblzma.so.5.2.2
[root@jouet ~]#

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2880e22..8ab0d7d 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -346,7 +346,8 @@ out:
 		if (!strcmp(execname, ""))
 			strcpy(execname, anonstr);
 
-		if (!strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
+		if (hugetlbfs_mnt_len &&
+		    !strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
 			strcpy(execname, anonstr);
 			event->mmap2.flags |= MAP_HUGETLB;
 		}

[toc] | [prev] | [next] | [standalone]


#1490200 — [PATCH 10/16] perf intel-pt: Add support for recording the max non-turbo ratio

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-23 16:50 +0200
Subject[PATCH 10/16] perf intel-pt: Add support for recording the max non-turbo ratio
Message-ID<skzXA-53e-55@gated-at.bofh.it>
In reply to#1490196
Previously the maximum non-turbo ratio was calculated from TSC assuming a
100 MHz multiplier which is correct for current hardware supporting
Intel PT.  However more recent kernels also now export the value, so use
that in preference to the calculated value.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/arch/x86/util/intel-pt.c |  6 ++++++
 tools/perf/util/intel-pt.c          | 14 +++++++++++++-
 tools/perf/util/intel-pt.h          |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index a2412e9d883b..18b21514c153 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -302,6 +302,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	bool cap_user_time_zero = false, per_cpu_mmaps;
 	u64 tsc_bit, mtc_bit, mtc_freq_bits, cyc_bit, noretcomp_bit;
 	u32 tsc_ctc_ratio_n, tsc_ctc_ratio_d;
+	unsigned long max_non_turbo_ratio;
 	int err;
 
 	if (priv_size != INTEL_PT_AUXTRACE_PRIV_SIZE)
@@ -317,6 +318,10 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 
 	intel_pt_tsc_ctc_ratio(&tsc_ctc_ratio_n, &tsc_ctc_ratio_d);
 
+	if (perf_pmu__scan_file(intel_pt_pmu, "max_nonturbo_ratio",
+				"%lu", &max_non_turbo_ratio) != 1)
+		max_non_turbo_ratio = 0;
+
 	if (!session->evlist->nr_mmaps)
 		return -EINVAL;
 
@@ -351,6 +356,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_N] = tsc_ctc_ratio_n;
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_D] = tsc_ctc_ratio_d;
 	auxtrace_info->priv[INTEL_PT_CYC_BIT] = cyc_bit;
+	auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO] = max_non_turbo_ratio;
 
 	return 0;
 }
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index b744ea812a2e..77fbf02c8e41 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2023,6 +2023,7 @@ static const char * const intel_pt_info_fmts[] = {
 	[INTEL_PT_TSC_CTC_N]		= "  TSC:CTC numerator   %"PRIu64"\n",
 	[INTEL_PT_TSC_CTC_D]		= "  TSC:CTC denominator %"PRIu64"\n",
 	[INTEL_PT_CYC_BIT]		= "  CYC bit             %#"PRIx64"\n",
+	[INTEL_PT_MAX_NONTURBO_RATIO]	= "  Max non-turbo ratio %"PRIu64"\n",
 };
 
 static void intel_pt_print_info(u64 *arr, int start, int finish)
@@ -2087,6 +2088,15 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 				    INTEL_PT_CYC_BIT);
 	}
 
+	if (auxtrace_info->header.size >= sizeof(struct auxtrace_info_event) +
+				(sizeof(u64) * INTEL_PT_MAX_NONTURBO_RATIO)) {
+		pt->max_non_turbo_ratio =
+			auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO];
+		intel_pt_print_info(&auxtrace_info->priv[0],
+				    INTEL_PT_MAX_NONTURBO_RATIO,
+				    INTEL_PT_MAX_NONTURBO_RATIO);
+	}
+
 	pt->timeless_decoding = intel_pt_timeless_decoding(pt);
 	pt->have_tsc = intel_pt_have_tsc(pt);
 	pt->sampling_mode = false;
@@ -2156,7 +2166,9 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	if (pt->tc.time_mult) {
 		u64 tsc_freq = intel_pt_ns_to_ticks(pt, 1000000000);
 
-		pt->max_non_turbo_ratio = (tsc_freq + 50000000) / 100000000;
+		if (!pt->max_non_turbo_ratio)
+			pt->max_non_turbo_ratio =
+					(tsc_freq + 50000000) / 100000000;
 		intel_pt_log("TSC frequency %"PRIu64"\n", tsc_freq);
 		intel_pt_log("Maximum non-turbo ratio %u\n",
 			     pt->max_non_turbo_ratio);
diff --git a/tools/perf/util/intel-pt.h b/tools/perf/util/intel-pt.h
index 0065949df693..8b8356233e6a 100644
--- a/tools/perf/util/intel-pt.h
+++ b/tools/perf/util/intel-pt.h
@@ -34,6 +34,7 @@ enum {
 	INTEL_PT_TSC_CTC_N,
 	INTEL_PT_TSC_CTC_D,
 	INTEL_PT_CYC_BIT,
+	INTEL_PT_MAX_NONTURBO_RATIO,
 	INTEL_PT_AUXTRACE_PRIV_MAX,
 };
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1493645 — [tip:perf/core] perf intel-pt: Add support for recording the max non-turbo ratio

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2016-09-29 20:20 +0200
Subject[tip:perf/core] perf intel-pt: Add support for recording the max non-turbo ratio
Message-ID<smO66-7D0-35@gated-at.bofh.it>
In reply to#1490200
Commit-ID:  fa8025c37454501a2df4a90ae84ff01f4aff8ba8
Gitweb:     http://git.kernel.org/tip/fa8025c37454501a2df4a90ae84ff01f4aff8ba8
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 23 Sep 2016 17:38:42 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 29 Sep 2016 11:17:03 -0300

perf intel-pt: Add support for recording the max non-turbo ratio

Previously the maximum non-turbo ratio was calculated from TSC assuming
a 100 MHz multiplier which is correct for current hardware supporting
Intel PT.  However more recent kernels also now export the value, so use
that in preference to the calculated value.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-11-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/intel-pt.c |  6 ++++++
 tools/perf/util/intel-pt.c          | 14 +++++++++++++-
 tools/perf/util/intel-pt.h          |  1 +
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index a2412e9..18b2151 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -302,6 +302,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	bool cap_user_time_zero = false, per_cpu_mmaps;
 	u64 tsc_bit, mtc_bit, mtc_freq_bits, cyc_bit, noretcomp_bit;
 	u32 tsc_ctc_ratio_n, tsc_ctc_ratio_d;
+	unsigned long max_non_turbo_ratio;
 	int err;
 
 	if (priv_size != INTEL_PT_AUXTRACE_PRIV_SIZE)
@@ -317,6 +318,10 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 
 	intel_pt_tsc_ctc_ratio(&tsc_ctc_ratio_n, &tsc_ctc_ratio_d);
 
+	if (perf_pmu__scan_file(intel_pt_pmu, "max_nonturbo_ratio",
+				"%lu", &max_non_turbo_ratio) != 1)
+		max_non_turbo_ratio = 0;
+
 	if (!session->evlist->nr_mmaps)
 		return -EINVAL;
 
@@ -351,6 +356,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_N] = tsc_ctc_ratio_n;
 	auxtrace_info->priv[INTEL_PT_TSC_CTC_D] = tsc_ctc_ratio_d;
 	auxtrace_info->priv[INTEL_PT_CYC_BIT] = cyc_bit;
+	auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO] = max_non_turbo_ratio;
 
 	return 0;
 }
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index b744ea8..77fbf02 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2023,6 +2023,7 @@ static const char * const intel_pt_info_fmts[] = {
 	[INTEL_PT_TSC_CTC_N]		= "  TSC:CTC numerator   %"PRIu64"\n",
 	[INTEL_PT_TSC_CTC_D]		= "  TSC:CTC denominator %"PRIu64"\n",
 	[INTEL_PT_CYC_BIT]		= "  CYC bit             %#"PRIx64"\n",
+	[INTEL_PT_MAX_NONTURBO_RATIO]	= "  Max non-turbo ratio %"PRIu64"\n",
 };
 
 static void intel_pt_print_info(u64 *arr, int start, int finish)
@@ -2087,6 +2088,15 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 				    INTEL_PT_CYC_BIT);
 	}
 
+	if (auxtrace_info->header.size >= sizeof(struct auxtrace_info_event) +
+				(sizeof(u64) * INTEL_PT_MAX_NONTURBO_RATIO)) {
+		pt->max_non_turbo_ratio =
+			auxtrace_info->priv[INTEL_PT_MAX_NONTURBO_RATIO];
+		intel_pt_print_info(&auxtrace_info->priv[0],
+				    INTEL_PT_MAX_NONTURBO_RATIO,
+				    INTEL_PT_MAX_NONTURBO_RATIO);
+	}
+
 	pt->timeless_decoding = intel_pt_timeless_decoding(pt);
 	pt->have_tsc = intel_pt_have_tsc(pt);
 	pt->sampling_mode = false;
@@ -2156,7 +2166,9 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	if (pt->tc.time_mult) {
 		u64 tsc_freq = intel_pt_ns_to_ticks(pt, 1000000000);
 
-		pt->max_non_turbo_ratio = (tsc_freq + 50000000) / 100000000;
+		if (!pt->max_non_turbo_ratio)
+			pt->max_non_turbo_ratio =
+					(tsc_freq + 50000000) / 100000000;
 		intel_pt_log("TSC frequency %"PRIu64"\n", tsc_freq);
 		intel_pt_log("Maximum non-turbo ratio %u\n",
 			     pt->max_non_turbo_ratio);
diff --git a/tools/perf/util/intel-pt.h b/tools/perf/util/intel-pt.h
index 0065949..8b83562 100644
--- a/tools/perf/util/intel-pt.h
+++ b/tools/perf/util/intel-pt.h
@@ -34,6 +34,7 @@ enum {
 	INTEL_PT_TSC_CTC_N,
 	INTEL_PT_TSC_CTC_D,
 	INTEL_PT_CYC_BIT,
+	INTEL_PT_MAX_NONTURBO_RATIO,
 	INTEL_PT_AUXTRACE_PRIV_MAX,
 };
 

[toc] | [prev] | [next] | [standalone]


#1490201 — [PATCH 08/16] perf tools: Increase debug level of SDT debug messages

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-23 16:50 +0200
Subject[PATCH 08/16] perf tools: Increase debug level of SDT debug messages
Message-ID<skzXA-53e-51@gated-at.bofh.it>
In reply to#1490196
Two SDT debug messages can occur for every DSO which is too noisy.
Consequently, increase debug level of SDT messages.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/build-id.c   | 4 ++--
 tools/perf/util/probe-file.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 5651f3c12f93..e528c40739cc 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -620,7 +620,7 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
 
 	ret = probe_cache__scan_sdt(cache, realname);
 	if (ret >= 0) {
-		pr_debug("Found %d SDTs in %s\n", ret, realname);
+		pr_debug4("Found %d SDTs in %s\n", ret, realname);
 		if (probe_cache__commit(cache) < 0)
 			ret = -1;
 	}
@@ -691,7 +691,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 
 	/* Update SDT cache : error is just warned */
 	if (build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
-		pr_debug("Failed to update/scan SDT cache for %s\n", realname);
+		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
 
 out_free:
 	if (!is_kallsyms)
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 6f931e442f14..436b64731f65 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -699,7 +699,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
 	INIT_LIST_HEAD(&sdtlist);
 	ret = get_sdt_note_list(&sdtlist, pathname);
 	if (ret < 0) {
-		pr_debug("Failed to get sdt note: %d\n", ret);
+		pr_debug4("Failed to get sdt note: %d\n", ret);
 		return ret;
 	}
 	list_for_each_entry(note, &sdtlist, note_list) {
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1490511 — Re: [PATCH 08/16] perf tools: Increase debug level of SDT debug messages

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2016-09-24 02:20 +0200
SubjectRe: [PATCH 08/16] perf tools: Increase debug level of SDT debug messages
Message-ID<skIRc-2lT-7@gated-at.bofh.it>
In reply to#1490201
On Fri, 23 Sep 2016 17:38:40 +0300
Adrian Hunter <adrian.hunter@intel.com> wrote:

> Two SDT debug messages can occur for every DSO which is too noisy.
> Consequently, increase debug level of SDT messages.

OK, but why "4" would you choose?

Thanks,

> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  tools/perf/util/build-id.c   | 4 ++--
>  tools/perf/util/probe-file.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> index 5651f3c12f93..e528c40739cc 100644
> --- a/tools/perf/util/build-id.c
> +++ b/tools/perf/util/build-id.c
> @@ -620,7 +620,7 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
>  
>  	ret = probe_cache__scan_sdt(cache, realname);
>  	if (ret >= 0) {
> -		pr_debug("Found %d SDTs in %s\n", ret, realname);
> +		pr_debug4("Found %d SDTs in %s\n", ret, realname);
>  		if (probe_cache__commit(cache) < 0)
>  			ret = -1;
>  	}
> @@ -691,7 +691,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
>  
>  	/* Update SDT cache : error is just warned */
>  	if (build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
> -		pr_debug("Failed to update/scan SDT cache for %s\n", realname);
> +		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
>  
>  out_free:
>  	if (!is_kallsyms)
> diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
> index 6f931e442f14..436b64731f65 100644
> --- a/tools/perf/util/probe-file.c
> +++ b/tools/perf/util/probe-file.c
> @@ -699,7 +699,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
>  	INIT_LIST_HEAD(&sdtlist);
>  	ret = get_sdt_note_list(&sdtlist, pathname);
>  	if (ret < 0) {
> -		pr_debug("Failed to get sdt note: %d\n", ret);
> +		pr_debug4("Failed to get sdt note: %d\n", ret);
>  		return ret;
>  	}
>  	list_for_each_entry(note, &sdtlist, note_list) {
> -- 
> 1.9.1
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1491120 — Re: [PATCH 08/16] perf tools: Increase debug level of SDT debug messages

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-26 09:40 +0200
SubjectRe: [PATCH 08/16] perf tools: Increase debug level of SDT debug messages
Message-ID<slyG6-XP-25@gated-at.bofh.it>
In reply to#1490511
On 24/09/16 03:15, Masami Hiramatsu wrote:
> On Fri, 23 Sep 2016 17:38:40 +0300
> Adrian Hunter <adrian.hunter@intel.com> wrote:
> 
>> Two SDT debug messages can occur for every DSO which is too noisy.
>> Consequently, increase debug level of SDT messages.
> 
> OK, but why "4" would you choose?

2 is used for displaying the event attributes, so it needs to be 3 or 4.  I
chose 4 because of the large number of messages and that the same messages
appear every time.

> 
> Thanks,
> 
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  tools/perf/util/build-id.c   | 4 ++--
>>  tools/perf/util/probe-file.c | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
>> index 5651f3c12f93..e528c40739cc 100644
>> --- a/tools/perf/util/build-id.c
>> +++ b/tools/perf/util/build-id.c
>> @@ -620,7 +620,7 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
>>  
>>  	ret = probe_cache__scan_sdt(cache, realname);
>>  	if (ret >= 0) {
>> -		pr_debug("Found %d SDTs in %s\n", ret, realname);
>> +		pr_debug4("Found %d SDTs in %s\n", ret, realname);
>>  		if (probe_cache__commit(cache) < 0)
>>  			ret = -1;
>>  	}
>> @@ -691,7 +691,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
>>  
>>  	/* Update SDT cache : error is just warned */
>>  	if (build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
>> -		pr_debug("Failed to update/scan SDT cache for %s\n", realname);
>> +		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
>>  
>>  out_free:
>>  	if (!is_kallsyms)
>> diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
>> index 6f931e442f14..436b64731f65 100644
>> --- a/tools/perf/util/probe-file.c
>> +++ b/tools/perf/util/probe-file.c
>> @@ -699,7 +699,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
>>  	INIT_LIST_HEAD(&sdtlist);
>>  	ret = get_sdt_note_list(&sdtlist, pathname);
>>  	if (ret < 0) {
>> -		pr_debug("Failed to get sdt note: %d\n", ret);
>> +		pr_debug4("Failed to get sdt note: %d\n", ret);
>>  		return ret;
>>  	}
>>  	list_for_each_entry(note, &sdtlist, note_list) {
>> -- 
>> 1.9.1
>>
> 
> 

[toc] | [prev] | [next] | [standalone]


#1492073 — Re: [PATCH 08/16] perf tools: Increase debug level of SDT debug messages

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2016-09-27 19:50 +0200
SubjectRe: [PATCH 08/16] perf tools: Increase debug level of SDT debug messages
Message-ID<sm4FX-410-3@gated-at.bofh.it>
In reply to#1491120
On Mon, 26 Sep 2016 10:27:41 +0300
Adrian Hunter <adrian.hunter@intel.com> wrote:

> On 24/09/16 03:15, Masami Hiramatsu wrote:
> > On Fri, 23 Sep 2016 17:38:40 +0300
> > Adrian Hunter <adrian.hunter@intel.com> wrote:
> > 
> >> Two SDT debug messages can occur for every DSO which is too noisy.
> >> Consequently, increase debug level of SDT messages.
> > 
> > OK, but why "4" would you choose?
> 
> 2 is used for displaying the event attributes, so it needs to be 3 or 4.  I
> chose 4 because of the large number of messages and that the same messages
> appear every time.

Hmm, yes, but this message is also useful for checking user to
stack on retrieving SDT or not. I think it is a time to introduce
debug printk like feature to perf, because we need to control on/off
depending on which subcommand we are debugging.

Anyway, at this point it is OK for me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

> 
> > 
> > Thanks,
> > 
> >>
> >> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> >> ---
> >>  tools/perf/util/build-id.c   | 4 ++--
> >>  tools/perf/util/probe-file.c | 2 +-
> >>  2 files changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> >> index 5651f3c12f93..e528c40739cc 100644
> >> --- a/tools/perf/util/build-id.c
> >> +++ b/tools/perf/util/build-id.c
> >> @@ -620,7 +620,7 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
> >>  
> >>  	ret = probe_cache__scan_sdt(cache, realname);
> >>  	if (ret >= 0) {
> >> -		pr_debug("Found %d SDTs in %s\n", ret, realname);
> >> +		pr_debug4("Found %d SDTs in %s\n", ret, realname);
> >>  		if (probe_cache__commit(cache) < 0)
> >>  			ret = -1;
> >>  	}
> >> @@ -691,7 +691,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
> >>  
> >>  	/* Update SDT cache : error is just warned */
> >>  	if (build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
> >> -		pr_debug("Failed to update/scan SDT cache for %s\n", realname);
> >> +		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
> >>  
> >>  out_free:
> >>  	if (!is_kallsyms)
> >> diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
> >> index 6f931e442f14..436b64731f65 100644
> >> --- a/tools/perf/util/probe-file.c
> >> +++ b/tools/perf/util/probe-file.c
> >> @@ -699,7 +699,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
> >>  	INIT_LIST_HEAD(&sdtlist);
> >>  	ret = get_sdt_note_list(&sdtlist, pathname);
> >>  	if (ret < 0) {
> >> -		pr_debug("Failed to get sdt note: %d\n", ret);
> >> +		pr_debug4("Failed to get sdt note: %d\n", ret);
> >>  		return ret;
> >>  	}
> >>  	list_for_each_entry(note, &sdtlist, note_list) {
> >> -- 
> >> 1.9.1
> >>
> > 
> > 
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1493656 — [tip:perf/core] perf probe: Increase debug level of SDT debug messages

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2016-09-29 20:20 +0200
Subject[tip:perf/core] perf probe: Increase debug level of SDT debug messages
Message-ID<smO66-7D0-51@gated-at.bofh.it>
In reply to#1490201
Commit-ID:  f9655200ecd2d6cc13900a727150177b94ca229e
Gitweb:     http://git.kernel.org/tip/f9655200ecd2d6cc13900a727150177b94ca229e
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 23 Sep 2016 17:38:40 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 29 Sep 2016 11:17:02 -0300

perf probe: Increase debug level of SDT debug messages

Two SDT debug messages can occur for every DSO which is too noisy.
Consequently, increase debug level of SDT messages.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-9-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/build-id.c   | 4 ++--
 tools/perf/util/probe-file.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 5651f3c..e528c40 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -620,7 +620,7 @@ static int build_id_cache__add_sdt_cache(const char *sbuild_id,
 
 	ret = probe_cache__scan_sdt(cache, realname);
 	if (ret >= 0) {
-		pr_debug("Found %d SDTs in %s\n", ret, realname);
+		pr_debug4("Found %d SDTs in %s\n", ret, realname);
 		if (probe_cache__commit(cache) < 0)
 			ret = -1;
 	}
@@ -691,7 +691,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *name,
 
 	/* Update SDT cache : error is just warned */
 	if (build_id_cache__add_sdt_cache(sbuild_id, realname) < 0)
-		pr_debug("Failed to update/scan SDT cache for %s\n", realname);
+		pr_debug4("Failed to update/scan SDT cache for %s\n", realname);
 
 out_free:
 	if (!is_kallsyms)
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 6f931e4..436b647 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -699,7 +699,7 @@ int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname)
 	INIT_LIST_HEAD(&sdtlist);
 	ret = get_sdt_note_list(&sdtlist, pathname);
 	if (ret < 0) {
-		pr_debug("Failed to get sdt note: %d\n", ret);
+		pr_debug4("Failed to get sdt note: %d\n", ret);
 		return ret;
 	}
 	list_for_each_entry(note, &sdtlist, note_list) {

[toc] | [prev] | [next] | [standalone]


#1490202 — [PATCH 11/16] perf intel-pt: Fix missing error codes processing auxtrace_info

FromAdrian Hunter <adrian.hunter@intel.com>
Date2016-09-23 16:50 +0200
Subject[PATCH 11/16] perf intel-pt: Fix missing error codes processing auxtrace_info
Message-ID<skzXA-53e-57@gated-at.bofh.it>
In reply to#1490196
Fix 2 places where the err variable was not being set.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/intel-pt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 77fbf02c8e41..96519e801e53 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2138,11 +2138,13 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 		pt->switch_evsel = intel_pt_find_sched_switch(session->evlist);
 		if (!pt->switch_evsel) {
 			pr_err("%s: missing sched_switch event\n", __func__);
+			err = -EINVAL;
 			goto err_delete_thread;
 		}
 	} else if (pt->have_sched_switch == 2 &&
 		   !intel_pt_find_switch(session->evlist)) {
 		pr_err("%s: missing context_switch attribute flag\n", __func__);
+		err = -EINVAL;
 		goto err_delete_thread;
 	}
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1493634 — [tip:perf/core] perf intel-pt: Fix missing error codes processing auxtrace_info

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2016-09-29 20:20 +0200
Subject[tip:perf/core] perf intel-pt: Fix missing error codes processing auxtrace_info
Message-ID<smO65-7D0-1@gated-at.bofh.it>
In reply to#1490202
Commit-ID:  4d34e10a9f9a38c611cac0deda8f91b064282747
Gitweb:     http://git.kernel.org/tip/4d34e10a9f9a38c611cac0deda8f91b064282747
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 23 Sep 2016 17:38:43 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 29 Sep 2016 11:17:04 -0300

perf intel-pt: Fix missing error codes processing auxtrace_info

Fix 2 places where the err variable was not being set.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: http://lkml.kernel.org/r/1474641528-18776-12-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/intel-pt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 77fbf02..96519e8 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -2138,11 +2138,13 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 		pt->switch_evsel = intel_pt_find_sched_switch(session->evlist);
 		if (!pt->switch_evsel) {
 			pr_err("%s: missing sched_switch event\n", __func__);
+			err = -EINVAL;
 			goto err_delete_thread;
 		}
 	} else if (pt->have_sched_switch == 2 &&
 		   !intel_pt_find_switch(session->evlist)) {
 		pr_err("%s: missing context_switch attribute flag\n", __func__);
+		err = -EINVAL;
 		goto err_delete_thread;
 	}
 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web