From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755925Ab3KVPQY (ORCPT ); Fri, 22 Nov 2013 10:16:24 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:56047 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755881Ab3KVPQW (ORCPT ); Fri, 22 Nov 2013 10:16:22 -0500 Subject: Re: [PATCH 13/22] tools lib traceevent: Add cfg80211 plugin From: Namhyung Kim To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, Corey Ashford , Frederic Weisbecker , Ingo Molnar , Paul Mackerras , Peter Zijlstra , Arnaldo Carvalho de Melo , Steven Rostedt , David Ahern In-Reply-To: <1385031680-9014-14-git-send-email-jolsa@redhat.com> References: <1385031680-9014-1-git-send-email-jolsa@redhat.com> <1385031680-9014-14-git-send-email-jolsa@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 23 Nov 2013 00:16:14 +0900 Message-ID: <1385133374.1747.83.camel@leonhard> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2013-11-21 (목), 12:01 +0100, Jiri Olsa: > 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 [SNIP] > +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, Just a nitpick. The function should return int or the return type should be _LONG for consistency. Thanks, Namhyung > + "__le16_to_cpup", > + PEVENT_FUNC_ARG_PTR, > + PEVENT_FUNC_ARG_VOID); > + return 0; > +}