mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Ahern <dsahern@gmail.com>
Cc: tglx@linutronix.de, acme@redhat.com, jolsa@redhat.com,
	eranian@google.com, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org, john.stultz@linaro.org,
	hpa@zytor.com, akpm@linux-foundation.org, mingo@kernel.org
Subject: Re: [PATCH] perf, record: Add clockid parameter
Date: Fri, 27 Mar 2015 18:20:59 +0100	[thread overview]
Message-ID: <20150327172059.GK23123@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <55158F25.9040100@gmail.com>

On Fri, Mar 27, 2015 at 11:11:01AM -0600, David Ahern wrote:
> >  tools/perf/builtin-record.c | 3 +++
> >  tools/perf/perf.h           | 1 +
> >  tools/perf/util/evsel.c     | 5 +++++
> >  3 files changed, 9 insertions(+)
> 
> missing Documentation/perf-record.txt update

--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -250,6 +250,11 @@ is off by default.
 --running-time::
 Record running and enabled time for read events (:S)
 
+-k::
+--clockid::
+Sets the clock id to use for the various time fields in the perf_event_type
+records. See clock_gettime().
+
 SEE ALSO
 --------
 linkperf:perf-stat[1], linkperf:perf-list[1]


> >+++ b/tools/perf/util/evsel.c
> >@@ -761,6 +761,11 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
> >  		attr->disabled = 0;
> >  		attr->enable_on_exec = 0;
> >  	}
> >+
> >+	if (opts->clockid >= 0) {
> >+		attr->use_clockid = 1;
> >+		attr->clockid = opts->clockid;
> >+	}
> >  }
> >
> >  static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
> >
> 
> This is a new feature which means use_clockid on older kernels will fail. So
> need to catch that and throw an error -- perhaps yet another probe function.

How does that work? What do I grep to find an example? I figured if the
kernel didn't support the syscall will fail and we'll terminate
someplace.

> Also, if the intent is to allow clock selection per event should there be an
> event modifier as well (see get_event_modifier())?

Nah, its not generally useful to mix clocks in a single recording. That
gets real confused real quick on when which event happened.

The per event configurability is handy to allow different (concurrent)
records different settings.

  reply	other threads:[~2015-03-27 17:21 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tip-34f439278cef7b1177f8ce24f9fc81dfc6221d3b@git.kernel.org>
2015-03-27 14:32 ` Peter Zijlstra
2015-03-27 17:11   ` David Ahern
2015-03-27 17:20     ` Peter Zijlstra [this message]
2015-03-27 17:35       ` David Ahern
2015-03-27 20:15         ` Arnaldo Carvalho de Melo
2015-03-27 21:59           ` Peter Zijlstra
2015-03-27 22:37             ` Stephane Eranian
2015-03-28  7:55               ` Peter Zijlstra
2015-03-30  1:00                 ` David Ahern
2015-03-30  8:24                   ` Peter Zijlstra
2015-03-30 17:11                     ` David Ahern
2015-03-30  9:17                 ` Peter Zijlstra
2015-03-30 17:17                   ` David Ahern
2015-03-30 19:32                     ` Peter Zijlstra
2015-03-30 19:39                       ` David Ahern
2015-03-30 17:24                 ` David Ahern
2015-03-30 19:33                   ` Peter Zijlstra
2015-03-30 19:41                     ` David Ahern
2015-03-30 19:43                       ` Stephane Eranian
2015-03-31  8:19                       ` Peter Zijlstra
2015-03-31 10:46                         ` [RFC][PATCH] perf tools: unify perf_event_attr printing Peter Zijlstra
2015-04-01 16:26                           ` Peter Zijlstra
2015-04-01 16:52                             ` Jiri Olsa
2015-04-02  9:01                               ` Adrian Hunter
2015-04-02 11:59                                 ` Peter Zijlstra
2015-04-02 12:54                                   ` Adrian Hunter
2015-04-03 16:11                                   ` Arnaldo Carvalho de Melo
2015-04-03 16:14                                     ` Arnaldo Carvalho de Melo
2015-04-02  8:12                             ` Ingo Molnar
2015-04-02 22:28                               ` Arnaldo Carvalho de Melo
2015-04-02  9:19                             ` Jiri Olsa
2015-03-30 17:33                 ` [PATCH] perf, record: Add clockid parameter David Ahern
2015-03-30 19:34                   ` Peter Zijlstra
2015-03-30 19:46                     ` David Ahern
2015-03-27 23:07           ` Stephane Eranian
2015-03-27 16:31 ` [tip:perf/timer] perf: Add per event clockid support Stephane Eranian
2015-03-27 16:35   ` Peter Zijlstra
2015-03-27 16:52     ` Stephane Eranian
2015-03-27 16:57       ` Peter Zijlstra
2015-03-27 17:00         ` Stephane Eranian

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=20150327172059.GK23123@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=john.stultz@linaro.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome