[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170314150658.7065-7-ravi.bangoria@linux.vnet.ibm.com>
Date: Tue, 14 Mar 2017 20:36:57 +0530
From: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
To: mingo@...hat.com, acme@...nel.org, mhiramat@...nel.org
Cc: brendan.d.gregg@...il.com, peterz@...radead.org,
alexander.shishkin@...ux.intel.com, wangnan0@...wei.com,
jolsa@...nel.org, ak@...ux.intel.com, treeze.taeung@...il.com,
mathieu.poirier@...aro.org, hekuang@...wei.com,
sukadev@...ux.vnet.ibm.com, ananth@...ibm.com,
naveen.n.rao@...ux.vnet.ibm.com, adrian.hunter@...el.com,
linux-kernel@...r.kernel.org, hemant@...ux.vnet.ibm.com,
Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Subject: [PATCH v5 6/7] perf/sdt: List events fetched from uprobe_events
List those events which are fetched from uprobe_events as 'event addr@...e'
followed by hint on how these events can be deleted with 'perf probe -d'
command.
For example:
$ sudo cat /sys/kernel/debug/tracing/uprobe_events
p:sdt_libpthread/mutex_release /usr/lib64/libpthread-2.24.so:0x000000000000b126
$ sudo ./perf record -a -e sdt_libpthread:mutex_release
Matching event(s) from uprobe_events:
sdt_libpthread:mutex_release 0xb126@...r/lib64/libpthread-2.24.so
Use 'perf probe -d <event>' to delete event(s).
Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
---
tools/perf/util/probe-event.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 7bf8783..e150de0 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3593,6 +3593,24 @@ static void sdt_warn_multi_events(int ctr, struct perf_probe_event *pev)
ctr, pev->group, pev->event);
}
+static void print_exst_sdt_events(struct probe_trace_event *tev)
+{
+ static bool msg_head;
+
+ if (!msg_head) {
+ pr_info("Matching event(s) from uprobe_events:\n");
+ msg_head = true;
+ }
+
+ pr_info(" %s:%s 0x%" PRIx64 "@%s\n", tev->group,
+ tev->event, tev->point.address, tev->point.module);
+}
+
+static void print_exst_sdt_event_footer(void)
+{
+ pr_info("Use 'perf probe -d <event>' to delete event(s).\n\n");
+}
+
static int sdt_event_probepoint_exists(struct perf_probe_event *pev,
struct probe_trace_event *tevs,
int ntevs,
@@ -3607,10 +3625,14 @@ static int sdt_event_probepoint_exists(struct perf_probe_event *pev,
if (ret < 0)
return ret;
+ print_exst_sdt_events(&tevs[i]);
ctr++;
}
}
+ if (ctr > 0)
+ print_exst_sdt_event_footer();
+
if (ctr > 1)
sdt_warn_multi_events(ctr, pev);
@@ -3660,11 +3682,16 @@ static int sdt_merge_events(struct perf_probe_event *pev,
if (!ptrn_used)
shift_sdt_events(pev, i);
+
+ print_exst_sdt_events(&exst_tevs[j]);
ctr++;
}
}
}
+ if (ctr > 0)
+ print_exst_sdt_event_footer();
+
if (!ptrn_used || ctr == 0) {
/*
* Create probe point for all probe-cached events by
--
2.9.3
Powered by blists - more mailing lists