All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@kernel.org>
Subject: [PATCH 01/14] perf record: Fix to honor user freq/interval properly
Date: Thu, 12 Jun 2014 17:30:32 +0200	[thread overview]
Message-ID: <1402587045-5461-2-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1402587045-5461-1-git-send-email-jolsa@kernel.org>

From: Namhyung Kim <namhyung@kernel.org>

When configuring event perf checked a wrong condition that user
specified both of freq (-F) and period (-c) or the event has no
default value.  This worked because most of events don't have default
value and only tracepoint events have default of 1 (and it's not
desirable to change it for those events).

However, Andi's downloadable event patch changes the situation so it
cannot change the value for those events.  Fix it by allowing override
the default value if user gives one of the options.

  $ perf record -a -e uops_retired.all -F 4000 sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.325 MB perf.data (~14185 samples) ]

  $ perf evlist -F
  cpu/uops_retired.all/: sample_freq=4000

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1402292617-26278-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/evsel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 21154da..8606175 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -589,10 +589,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
 	}
 
 	/*
-	 * We default some events to a 1 default interval. But keep
+	 * We default some events to have a default interval. But keep
 	 * it a weak assumption overridable by the user.
 	 */
-	if (!attr->sample_period || (opts->user_freq != UINT_MAX &&
+	if (!attr->sample_period || (opts->user_freq != UINT_MAX ||
 				     opts->user_interval != ULLONG_MAX)) {
 		if (opts->freq) {
 			perf_evsel__set_sample_bit(evsel, PERIOD);
-- 
1.8.3.1


  reply	other threads:[~2014-06-12 15:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 15:30 [GIT PULL 00/14] perf/core improvements and fixes Jiri Olsa
2014-06-12 15:30 ` Jiri Olsa [this message]
2014-06-12 15:30 ` [PATCH 02/14] perf tools: Cache register accesses for unwind processing Jiri Olsa
2014-06-12 15:30 ` [PATCH 03/14] perf tools: Separate dso data related variables Jiri Olsa
2014-06-12 15:30 ` [PATCH 04/14] perf tools: Add data_fd into dso object Jiri Olsa
2014-06-12 15:30 ` [PATCH 05/14] perf tools: Add global list of opened dso objects Jiri Olsa
2014-06-12 15:30 ` [PATCH 06/14] perf tools: Add global count " Jiri Olsa
2014-06-12 15:30 ` [PATCH 07/14] perf tools: Cache dso data file descriptor Jiri Olsa
2014-06-12 15:30 ` [PATCH 08/14] perf tools: Add file size check and factor dso__data_read_offset Jiri Olsa
2014-06-12 15:30 ` [PATCH 09/14] perf tools: Allow to close dso fd in case of open failure Jiri Olsa
2014-06-12 15:30 ` [PATCH 10/14] perf tools: Add dso__data_* interface descriptons Jiri Olsa
2014-06-12 15:30 ` [PATCH 11/14] perf tests: Spawn child for each test Jiri Olsa
2014-06-12 15:30 ` [PATCH 12/14] perf tests: Allow reuse of test_file function Jiri Olsa
2014-06-12 15:30 ` [PATCH 13/14] perf tests: Add test for caching dso file descriptors Jiri Olsa
2014-06-12 15:30 ` [PATCH 14/14] perf tests: Add test for closing dso objects on EMFILE error Jiri Olsa
2014-06-12 20:55 ` [GIT PULL 00/14] perf/core improvements and fixes Jean Pihet
2014-06-13  9:03   ` Jiri Olsa
2014-06-13  6:20 ` Ingo Molnar

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=1402587045-5461-2-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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.