All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung.kim@lge.com>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 09/15] perf tools: Check more combinations of PID/TID, UID and CPU switches
Date: Wed,  2 May 2012 16:24:56 -0300	[thread overview]
Message-ID: <1335986702-9408-10-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1335986702-9408-1-git-send-email-acme@infradead.org>

From: Namhyung Kim <namhyung.kim@lge.com>

There were some combinations of these switches that are not so
appropriate IMHO.

Since there are implicit priorities between them and they worked well
anyway, but it ends up opening useless duplicated events.

For example, 'perf stat -t <pid> -a' will open multiple events for the
thread instead of one.

Add explicit checks and warn user in perf_target__validate().

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1335417327-11796-7-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/usage.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c
index 0a1a885..228f0a5 100644
--- a/tools/perf/util/usage.c
+++ b/tools/perf/util/usage.c
@@ -132,4 +132,18 @@ void perf_target__validate(struct perf_target *target)
 		sleep(1);
 		target->uid_str = NULL;
 	}
+
+	/* UID and CPU are mutually exclusive */
+	if (target->uid_str && target->cpu_list) {
+		ui__warning("UID switch overriding CPU\n");
+		sleep(1);
+		target->cpu_list = NULL;
+	}
+
+	/* PID/UID and SYSTEM are mutually exclusive */
+	if ((target->tid || target->uid_str) && target->system_wide) {
+		ui__warning("PID/TID/UID switch overriding CPU\n");
+		sleep(1);
+		target->system_wide = false;
+	}
 }
-- 
1.7.9.2.358.g22243


  parent reply	other threads:[~2012-05-02 19:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 19:24 [GIT PULL 00/15] perf/core fixes and improvements Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 01/15] perf tools: Cleanup realloc use Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 02/15] perf test: Make the rdpmc test honour 'verbose' mode Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 03/15] perf tools: Fix include header files in util/parse-events.h Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 04/15] perf tools: Introduce struct perf_target Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 05/15] perf stat: Convert to " Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 06/15] perf top: " Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 07/15] perf tools: Introduce perf_target__validate() helper Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 08/15] perf evlist: Make create_maps() take struct perf_target Arnaldo Carvalho de Melo
2012-05-02 19:24 ` Arnaldo Carvalho de Melo [this message]
2012-05-02 19:24 ` [PATCH 10/15] perf target: Split out perf_target handling code Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 11/15] perf ui: Make setup_browser() generic Arnaldo Carvalho de Melo
2012-05-02 19:24 ` [PATCH 12/15] perf ui gtk: Drop arg[cv] arguments from perf_gtk_setup_browser() Arnaldo Carvalho de Melo
2012-05-02 19:25 ` [PATCH 13/15] perf ui gtk: Rename functions for consistency Arnaldo Carvalho de Melo
2012-05-02 19:25 ` [PATCH 14/15] perf ui: Add gtk2 support into setup_browser() Arnaldo Carvalho de Melo
2012-05-02 19:25 ` [PATCH 15/15] perf ui: Change fallback policy of setup_browser() Arnaldo Carvalho de Melo

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=1335986702-9408-10-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.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.