All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Andi Kleen <andi@firstfloor.org>, David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 07/10] perf evsel: Set attr.task bit for a tracking event
Date: Thu, 29 Jan 2015 17:23:42 -0300	[thread overview]
Message-ID: <1422563025-28402-8-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1422563025-28402-1-git-send-email-acme@kernel.org>

From: Namhyung Kim <namhyung@kernel.org>

The perf_event_attr.task bit is to track task (fork and exit) events but
it missed to be set by perf_evsel__config().  While it was not a problem
in practice since setting other bits (comm/mmap) ended up being in same
result, it'd be good to set it explicitly anyway.

The attr->task is to track task related events (fork/exit) only but
other meta events like comm and mmap[2] also needs the task events.  So
setting attr->comm and/or attr->mmap causes the kernel emits the task
events anyway.  So the attr->task is only meaningful when other bits are
off but I'd like to set it for completeness.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1422518843-25818-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1d826d63bc20..ea51a90e20a0 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -709,6 +709,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
 	if (opts->sample_weight)
 		perf_evsel__set_sample_bit(evsel, WEIGHT);
 
+	attr->task  = track;
 	attr->mmap  = track;
 	attr->mmap2 = track && !perf_missing_features.mmap2;
 	attr->comm  = track;
-- 
1.9.3


  parent reply	other threads:[~2015-01-29 20:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 20:23 [GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 01/10] perf evsel: Don't rely on malloc working for sz 0 Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 02/10] perf tools: Provide stub for missing pthread_attr_setaffinity_np Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 03/10] perf callchain: Cache eh/debug frame offset for dwarf unwind Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 04/10] perf tools: Do not use __perf_session__process_events() directly Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 05/10] perf record: Show precise number of samples Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 06/10] perf header: Set header version correctly Arnaldo Carvalho de Melo
2015-01-29 20:23 ` Arnaldo Carvalho de Melo [this message]
2015-01-29 20:23 ` [PATCH 08/10] perf symbols: Support to read compressed module from build-id cache Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 09/10] perf tools: Use perf_data_file__fd() consistently Arnaldo Carvalho de Melo
2015-01-29 20:23 ` [PATCH 10/10] perf symbols: Convert lseek + read to pread Arnaldo Carvalho de Melo
2015-01-30 18:28 ` [GIT PULL 00/10] perf/core improvements and fixes 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=1422563025-28402-8-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.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.