All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] tools lib traceevent: Add retrieval of preempt count and latency flags
Date: Tue, 22 Nov 2016 15:52:45 +0900	[thread overview]
Message-ID: <20161122065245.GA10108@danjae.aot.lge.com> (raw)
In-Reply-To: <20161118225457.823985960@goodmis.org>

Hi Steve,

On Fri, Nov 18, 2016 at 05:54:00PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> 
> Add a way to retrieve the preempt count as well as the latency flags from a
> pevent_record.
> 
>  int pevent_data_pc(pevent, record);

I think pevent_data_preempt_count() is better..

Thanks,
Namhyung


> 
> returns the preempt count of a record.
> 
>  int pevent_data_flags(pevent, record);
> 
> returns the latency flags for a record.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  tools/lib/traceevent/event-parse.c | 30 ++++++++++++++++++++++++++++--
>  tools/lib/traceevent/event-parse.h |  2 ++
>  2 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index 664c90c8e22b..d6f3cc0a29b0 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -5191,11 +5191,11 @@ struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type
>  }
>  
>  /**
> - * pevent_data_pid - parse the PID from raw data
> + * pevent_data_pid - parse the PID from record
>   * @pevent: a handle to the pevent
>   * @rec: the record to parse
>   *
> - * This returns the PID from a raw data.
> + * This returns the PID from a record.
>   */
>  int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec)
>  {
> @@ -5203,6 +5203,32 @@ int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec)
>  }
>  
>  /**
> + * pevent_data_pc - parse the preempt count from the record
> + * @pevent: a handle to the pevent
> + * @rec: the record to parse
> + *
> + * This returns the preempt count from a record.
> + */
> +int pevent_data_pc(struct pevent *pevent, struct pevent_record *rec)
> +{
> +	return parse_common_pc(pevent, rec->data);
> +}
> +
> +/**
> + * pevent_data_flags - parse the latency flags from the record
> + * @pevent: a handle to the pevent
> + * @rec: the record to parse
> + *
> + * This returns the latency flags from a record.
> + *
> + *  Use trace_flag_type enum for the flags (see event-parse.h).
> + */
> +int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec)
> +{
> +	return parse_common_flags(pevent, rec->data);
> +}
> +
> +/**
>   * pevent_data_comm_from_pid - return the command line from PID
>   * @pevent: a handle to the pevent
>   * @pid: the PID of the task to search for
> diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
> index 9ffde377e89d..41b3d2238ed3 100644
> --- a/tools/lib/traceevent/event-parse.h
> +++ b/tools/lib/traceevent/event-parse.h
> @@ -712,6 +712,8 @@ void pevent_data_lat_fmt(struct pevent *pevent,
>  int pevent_data_type(struct pevent *pevent, struct pevent_record *rec);
>  struct event_format *pevent_data_event_from_type(struct pevent *pevent, int type);
>  int pevent_data_pid(struct pevent *pevent, struct pevent_record *rec);
> +int pevent_data_pc(struct pevent *pevent, struct pevent_record *rec);
> +int pevent_data_flags(struct pevent *pevent, struct pevent_record *rec);
>  const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid);
>  struct cmdline;
>  struct cmdline *pevent_data_pid_from_comm(struct pevent *pevent, const char *comm,
> -- 
> 2.10.2
> 
> 

  reply	other threads:[~2016-11-22  6:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 22:53 [PATCH 0/2] tools lib traceevent: A couple of updates Steven Rostedt
2016-11-18 22:54 ` [PATCH 1/2] tools lib traceevent: Add retrieval of preempt count and latency flags Steven Rostedt
2016-11-22  6:52   ` Namhyung Kim [this message]
2016-11-22 14:33     ` Steven Rostedt
2016-11-22 16:31     ` [PATCH v2] " Steven Rostedt
2016-11-22 18:06       ` Arnaldo Carvalho de Melo
2016-11-23  4:45         ` Namhyung Kim
2016-11-24  4:15       ` [tip:perf/core] " tip-bot for Steven Rostedt
2016-11-18 22:54 ` [PATCH 2/2] tools lib traceevent: Use USECS_PER_SEC instead of hardcoded number Steven Rostedt
2016-11-18 23:40   ` Arnaldo Carvalho de Melo
2016-11-21 16:41     ` Steven Rostedt
2016-11-21 19:11       ` Arnaldo Carvalho de Melo
2016-11-22  6:53       ` Namhyung Kim
2016-11-24  4:14       ` [tip:perf/core] " tip-bot for Steven Rostedt

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=20161122065245.GA10108@danjae.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.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.