From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753180Ab3LJJVj (ORCPT ); Tue, 10 Dec 2013 04:21:39 -0500 Received: from terminus.zytor.com ([198.137.202.10]:44533 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921Ab3LJJV3 (ORCPT ); Tue, 10 Dec 2013 04:21:29 -0500 Date: Tue, 10 Dec 2013 01:21:00 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl, namhyung@kernel.org, jolsa@redhat.com, fweisbec@gmail.com, rostedt@goodmis.org, dsahern@gmail.com, tglx@linutronix.de, cjashfor@linux.vnet.ibm.com, mingo@elte.hu Reply-To: mingo@kernel.org, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, namhyung@kernel.org, jolsa@redhat.com, fweisbec@gmail.com, rostedt@goodmis.org, dsahern@gmail.com, tglx@linutronix.de, cjashfor@linux.vnet.ibm.com, mingo@elte.hu In-Reply-To: <1386076182-14484-22-git-send-email-jolsa@redhat.com> References: <1386076182-14484-22-git-send-email-jolsa@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib traceevent: Add cfg80211 plugin Git-Commit-ID: 943714737374635a134dc3de59a7f062cea53fb3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.1 (terminus.zytor.com [127.0.0.1]); Tue, 10 Dec 2013 01:21:06 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 943714737374635a134dc3de59a7f062cea53fb3 Gitweb: http://git.kernel.org/tip/943714737374635a134dc3de59a7f062cea53fb3 Author: Jiri Olsa AuthorDate: Tue, 3 Dec 2013 14:09:35 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 4 Dec 2013 15:35:27 -0300 tools lib traceevent: Add cfg80211 plugin Adding cfg80211 plugin. This plugin adds handler for __le16_to_cpup function t properly parse following tracepoint events: cfg80211:cfg80211_tx_mlme_mgmt cfg80211:cfg80211_rx_mlme_mgmt cfg80211:cfg80211_rx_unprot_mlme_mgmt The diff of 'perf script' output generated by old and new code: (data was generated by 'perf record -e 'cfg80211:*' -a') --- script.cfg80211.old +++ script.cfg80211.new - ifconfig 2705 [003] 662.896560: cfg80211:cfg80211_tx_mlme_mgmt: [FAILED TO PARSE] name=wlan0 ifindex=3 frame=ARRAY[c0, 00, 00, 00, 00, 3a, 98, a0, 30, 51, 10, 0b, a9, c6, f4, 74, 00, 3a, 98, a0, 30, 51, 00, 00, 03, 00] + ifconfig 2705 [003] 662.896560: cfg80211:cfg80211_tx_mlme_mgmt: netdev:wlan0(3), ftype:0xc0 - kworker/u16:0 1697 [002] 664.808210: cfg80211:cfg80211_rx_mlme_mgmt: [FAILED TO PARSE] name=wlan0 ifindex=3 frame=ARRAY[b0, 00, da, 00, 10, 0b, a9, c6, f4, 74, d8, 24, bd, a1, 26, 31, d8, 24, bd, a1, 26, 31, 10, b7, 00, 00, 02, 00, 00, 00] + kworker/u16:0 1697 [002] 664.808210: cfg80211:cfg80211_rx_mlme_mgmt: netdev:wlan0(3), ftype:0xb0 Signed-off-by: Jiri Olsa Cc: Corey Ashford Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/1386076182-14484-22-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/Makefile | 1 + tools/lib/traceevent/plugin_cfg80211.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index 671f969..0d9cbb4 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile @@ -221,6 +221,7 @@ PLUGIN_OBJS += plugin_sched_switch.o PLUGIN_OBJS += plugin_function.o PLUGIN_OBJS += plugin_xen.o PLUGIN_OBJS += plugin_scsi.o +PLUGIN_OBJS += plugin_cfg80211.o PLUGINS := $(PLUGIN_OBJS:.o=.so) diff --git a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c new file mode 100644 index 0000000..dcab8e8 --- /dev/null +++ b/tools/lib/traceevent/plugin_cfg80211.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include "event-parse.h" + +static unsigned long long +process___le16_to_cpup(struct trace_seq *s, + unsigned long long *args) +{ + uint16_t *val = (uint16_t *) args[0]; + return val ? (long long) le16toh(*val) : 0; +} + +int PEVENT_PLUGIN_LOADER(struct pevent *pevent) +{ + pevent_register_print_function(pevent, + process___le16_to_cpup, + PEVENT_FUNC_ARG_INT, + "__le16_to_cpup", + PEVENT_FUNC_ARG_PTR, + PEVENT_FUNC_ARG_VOID); + return 0; +}