All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH 06/29] tools lib traceevent: Add jbd2 plugin
Date: Fri, 29 Nov 2013 15:42:35 -0300	[thread overview]
Message-ID: <20131129184235.GA12850@ghostprotocols.net> (raw)
In-Reply-To: <1385638408-23519-7-git-send-email-jolsa@redhat.com>

Em Thu, Nov 28, 2013 at 12:33:05PM +0100, Jiri Olsa escreveu:
> Backporting jbd2 plugin.
> 
> Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
> 
> This plugin adds field resolving functions for following
> tracepoint events:
>   jbd2:jbd2_checkpoint_stats
>   jbd2:jbd2_run_stats
> 
> The diff of 'perf script' output generated by old and new code:
> (data was generated by 'perf record -e 'jbd2:jbd2_run_stats,jbd2:jbd2_checkpoint_stats' -a')


The lines after one that starts with

---

are ignored by 'git am', please ident them with at least one space,
I'm doing that this time.
 
> --- script.jbd2.old
> +++ script.jbd2.new
> -     jbd2/dm-3-8   576 [000]  2983.748423: jbd2:jbd2_checkpoint_stats: [FAILED TO PARSE] dev=265289731 tid=0x3f2bbb chp_time=0x0 forced_to_close=0 written=0 dropped=2
> +     jbd2/dm-3-8   576 [000]  2983.748423: jbd2:jbd2_checkpoint_stats: dev 253,3 tid 4139963 chp_time 0 forced_to_close 0 written 0 dropped 2
> -     jbd2/dm-3-8   576 [000]  2983.852789: jbd2:jbd2_run_stats: [FAILED TO PARSE] dev=265289731 tid=0x3f2bc0 wait=0x0 request_delay=0x0 running=0x138d locked=0x0 flushing=0x0 logging=0x68 handle_count=2995 blocks=17 blocks_logged=18
> +     jbd2/dm-3-8   576 [000]  2983.852789: jbd2:jbd2_run_stats: dev 253,3 tid 4139968 wait 0 request_delay 0 running 5005 locked 0 flushing 0 logging 104 handle_count 2995 blocks 17 blocks_logged 18
> 
> This plugin also adds jbd2_dev_to_name function, which
> was removed from jdb2 tracepoints recently. Keeping it
> in for backward compatibility reasons.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Jiri Olsa <jolsa@redhat.com>
> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: David Ahern <dsahern@gmail.com>
> ---
>  tools/lib/traceevent/Makefile      |  2 ++
>  tools/lib/traceevent/plugin_jbd2.c | 66 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 68 insertions(+)
>  create mode 100644 tools/lib/traceevent/plugin_jbd2.c
> 
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index 1526798..474485a 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -212,6 +212,8 @@ PEVENT_LIB_OBJS += parse-filter.o
>  PEVENT_LIB_OBJS += parse-utils.o
>  PEVENT_LIB_OBJS += kbuffer-parse.o
>  
> +PLUGIN_OBJS = plugin_jbd2.o
> +
>  PLUGINS := $(PLUGIN_OBJS:.o=.so)
>  
>  ALL_OBJS = $(PEVENT_LIB_OBJS) $(PLUGIN_OBJS)
> diff --git a/tools/lib/traceevent/plugin_jbd2.c b/tools/lib/traceevent/plugin_jbd2.c
> new file mode 100644
> index 0000000..5d85de7
> --- /dev/null
> +++ b/tools/lib/traceevent/plugin_jbd2.c
> @@ -0,0 +1,66 @@
> +/*
> + * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation;
> + * version 2.1 of the License (not later!)
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this program; if not,  see <http://www.gnu.org/licenses>
> + *
> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + */
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +
> +#include "event-parse.h"
> +
> +#define MINORBITS	20
> +#define MINORMASK	((1U << MINORBITS) - 1)
> +
> +#define MAJOR(dev)	((unsigned int) ((dev) >> MINORBITS))
> +#define MINOR(dev)	((unsigned int) ((dev) & MINORMASK))
> +
> +unsigned long long process_jbd2_dev_to_name(struct trace_seq *s,
> +					    unsigned long long *args)
> +{
> +	unsigned int dev = args[0];
> +
> +	trace_seq_printf(s, "%d:%d", MAJOR(dev), MINOR(dev));
> +	return 0;
> +}
> +
> +unsigned long long process_jiffies_to_msecs(struct trace_seq *s,
> +					    unsigned long long *args)
> +{
> +	unsigned long long jiffies = args[0];
> +
> +	trace_seq_printf(s, "%lld", jiffies);
> +	return jiffies;
> +}
> +
> +int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
> +{
> +	pevent_register_print_function(pevent,
> +				       process_jbd2_dev_to_name,
> +				       PEVENT_FUNC_ARG_STRING,
> +				       "jbd2_dev_to_name",
> +				       PEVENT_FUNC_ARG_INT,
> +				       PEVENT_FUNC_ARG_VOID);
> +
> +	pevent_register_print_function(pevent,
> +				       process_jiffies_to_msecs,
> +				       PEVENT_FUNC_ARG_LONG,
> +				       "jiffies_to_msecs",
> +				       PEVENT_FUNC_ARG_LONG,
> +				       PEVENT_FUNC_ARG_VOID);
> +	return 0;
> +}
> -- 
> 1.8.3.1

  reply	other threads:[~2013-11-29 18:42 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 11:32 [PATCHv2 00/27] perf tools: Add traceevent plugins support Jiri Olsa
2013-11-28 11:33 ` [PATCH 01/29] perf tools: Remove stackprotector feature check Jiri Olsa
2013-11-29 18:34   ` Arnaldo Carvalho de Melo
2013-11-30 16:46     ` [PATCHv3 " Jiri Olsa
2013-12-01 12:21       ` Ingo Molnar
2013-11-28 11:33 ` [PATCH 02/29] perf tools: Include test-stackprotector-all.c in test-all Jiri Olsa
2013-12-04 15:41   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-11-28 11:33 ` [PATCH 03/29] tools lib traceevent: Add plugin support Jiri Olsa
2013-11-28 11:33 ` [PATCH 04/29] tools lib traceevent: Add plugin build support Jiri Olsa
2013-11-28 11:33 ` [PATCH 05/29] tools lib traceevent: Add traceevent_host_bigendian function Jiri Olsa
2013-11-28 11:33 ` [PATCH 06/29] tools lib traceevent: Add jbd2 plugin Jiri Olsa
2013-11-29 18:42   ` Arnaldo Carvalho de Melo [this message]
2013-11-29 19:31     ` Arnaldo Carvalho de Melo
2013-11-30 16:49       ` Jiri Olsa
2013-12-02 19:26         ` Arnaldo Carvalho de Melo
2013-12-02 19:31           ` Jiri Olsa
2013-11-30 16:46     ` Jiri Olsa
2013-11-28 11:33 ` [PATCH 07/29] tools lib traceevent: Add hrtimer plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 08/29] tools lib traceevent: Add kmem plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 09/29] tools lib traceevent: Add kvm plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 10/29] tools lib traceevent: Add mac80211 plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 11/29] tools lib traceevent: Add sched_switch plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 12/29] tools lib traceevent: Add function plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 13/29] tools lib traceevent: Add xen plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 14/29] tools lib traceevent: Add scsi plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 15/29] tools lib traceevent: Add cfg80211 plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 16/29] tools lib traceevent: Remove malloc_or_die from event-plugin.c Jiri Olsa
2013-11-28 11:33 ` [PATCH 17/29] tools lib traceevent: Use static functions in jbd2 plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 18/29] tools lib traceevent: Use pevent_print_func_field in hrtimer_start handler Jiri Olsa
2013-11-28 11:33 ` [PATCH 19/29] tools lib traceevent: Several cleanups for function plugin Jiri Olsa
2013-11-28 11:33 ` [PATCH 20/29] tools lib traceevent: Remove malloc_or_die from plugin_function.c Jiri Olsa
2013-11-29  6:41   ` Namhyung Kim
2013-11-29 10:37     ` [PATCHv3 " Jiri Olsa
2013-11-29 10:54       ` Namhyung Kim
2013-11-29 12:42         ` Jiri Olsa
2013-12-02  8:29           ` Namhyung Kim
2013-11-28 11:33 ` [PATCH 21/29] tools lib traceevent: Update kvm plugin with is_writable_pte helper Jiri Olsa
2013-11-28 11:33 ` [PATCH 22/29] tools lib traceevent: Change pevent_parse_format to include pevent handle Jiri Olsa
2013-11-28 11:33 ` [PATCH 23/29] tools lib traceevent: Harmonize the install messages in lib-traceevent Jiri Olsa
2013-11-28 11:33 ` [PATCH 24/29] perf tools: Add build and install plugins targets Jiri Olsa
2013-11-28 11:33 ` [PATCH 25/29] perf tools: Add udis86 disassembler feature check Jiri Olsa
2013-11-28 11:33 ` [PATCH 26/29] perf tools: Add filename__read_str util function Jiri Olsa
2013-11-28 11:33 ` [PATCH 27/29] perf tools: Add trace-event object Jiri Olsa
2013-11-28 11:33 ` [PATCH 28/29] perf tools: Add trace-event global object for tracepoint interface Jiri Olsa
2013-11-28 11:33 ` [PATCH 29/29] perf tools: Overload pr_stat traceevent print function Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131129184235.GA12850@ghostprotocols.net \
    --to=acme@ghostprotocols.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.