From: Peter Zijlstra <peterz@infradead.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, fweisbec@gmail.com,
lizf@cn.fujitsu.com
Subject: Re: [git pull] timechart for -tip
Date: Fri, 18 Sep 2009 21:37:45 +0200 [thread overview]
Message-ID: <1253302665.10538.54.camel@laptop> (raw)
In-Reply-To: <20090918212636.627cf799@infradead.org>
On Fri, 2009-09-18 at 21:26 +0200, Arjan van de Ven wrote:
> @@ -3098,7 +3102,10 @@ static void perf_counter_task_output(struct perf_counter *counter,
> task_event->event.tid = perf_counter_tid(counter, task);
> task_event->event.ptid = perf_counter_tid(counter, current);
>
> + task_event->event.time = sched_clock();
> +
> perf_output_put(&handle, task_event->event);
> +
> perf_output_end(&handle);
> }
>
That's supposed to be perf_clock(), someone made me change that just
now :-)
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 2459e5a..7ac1968 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -47,6 +47,7 @@ static int append_file = 0;
> static int call_graph = 0;
> static int inherit_stat = 0;
> static int no_samples = 0;
> +static int timechart = 0;
> static int sample_address = 0;
> static int multiplex = 0;
> static int multiplex_fd = -1;
> @@ -387,6 +388,12 @@ static void create_counter(int counter, int cpu, pid_t pid)
>
> attr->sample_type |= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
>
> + if (timechart) {
> + attr->sample_type |= PERF_SAMPLE_CPU;
> + attr->sample_type |= PERF_SAMPLE_TIME;
> + attr->sample_type |= PERF_SAMPLE_RAW;
> + }
> +
> if (freq) {
> attr->sample_type |= PERF_SAMPLE_PERIOD;
> attr->freq = 1;
> @@ -661,6 +668,24 @@ static int __cmd_record(int argc, const char **argv)
> return 0;
> }
>
> +static int do_timechart(const struct option *opt __used, const char *str __used, int unset __used)
> +{
> + parse_events(NULL, "power:power_start", 0);
> + parse_events(NULL, "power:power_end", 0);
> + parse_events(NULL, "power:power_frequency", 0);
> + parse_events(NULL, "sched:sched_wakeup", 0);
> + parse_events(NULL, "sched:sched_switch", 0);
> + default_interval = 1;
> + system_wide = 1;
> + timechart = 1;
> + if (!nr_counters) {
> + printf("No counters found.. is debugfs mounted?\n");
> + exit(0);
> + }
> + return 0;
> +}
> +
> +
> static const char * const record_usage[] = {
> "perf record [<options>] [<command>]",
> "perf record [<options>] -- <command> [<options>]",
> @@ -707,6 +732,9 @@ static const struct option options[] = {
> "don't sample"),
> OPT_BOOLEAN('M', "multiplex", &multiplex,
> "multiplex counter output in a single channel"),
> + OPT_CALLBACK_NOOPT('t', "timechart", NULL, NULL,
> + "create a timechart recording",
> + do_timechart),
> OPT_END()
> };
Now that we have perf sched record, should this not look like perf
timechart record?
Otherwise they look good. Great work!
prev parent reply other threads:[~2009-09-18 19:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 20:13 [git pull] timechart for -tip Arjan van de Ven
2009-09-18 19:26 ` Arjan van de Ven
2009-09-18 19:37 ` Peter Zijlstra [this message]
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=1253302665.10538.54.camel@laptop \
--to=peterz@infradead.org \
--cc=arjan@infradead.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
/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.