lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-shmwd1khzpaobr3i0j1ygapg@git.kernel.org>
Date:	Thu, 26 Feb 2015 03:31:48 -0800
From:	tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	dzickus@...hat.com, namhyung@...nel.org, peterz@...radead.org,
	linux-kernel@...r.kernel.org, mingo@...nel.org, tglx@...utronix.de,
	adrian.hunter@...el.com, jolsa@...hat.com, hpa@...or.com,
	dsahern@...il.com, fweisbec@...il.com, eranian@...gle.com,
	bp@...e.de, acme@...hat.com, efault@....de
Subject: [tip:perf/core] perf trace:
  Filter out the trace pid when no threads are specified

Commit-ID:  241b057ce5c01a24c280f124fab60109cb562589
Gitweb:     http://git.kernel.org/tip/241b057ce5c01a24c280f124fab60109cb562589
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Sat, 21 Feb 2015 10:15:21 -0800
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Sun, 22 Feb 2015 22:14:48 -0300

perf trace: Filter out the trace pid when no threads are specified

To avoid tracing the tracer.

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mike Galbraith <efault@....de>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-shmwd1khzpaobr3i0j1ygapg@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-trace.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 3a696aa..cb33e4c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2151,6 +2151,15 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 	if (err < 0)
 		goto out_error_open;
 
+	/*
+	 * Better not use !target__has_task() here because we need to cover the
+	 * case where no threads were specified in the command line, but a
+	 * workload was, and in that case we will fill in the thread_map when
+	 * we fork the workload in perf_evlist__prepare_workload.
+	 */
+	if (evlist->threads->map[0] == -1)
+		perf_evlist__set_filter_pid(evlist, getpid());
+
 	err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false);
 	if (err < 0)
 		goto out_error_mmap;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ