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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428424862-30032-2-git-send-email-acme@kernel.org>
Date:	Tue,  7 Apr 2015 13:40:47 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Borislav Petkov <bp@...e.de>, David Ahern <dsahern@...il.com>,
	Don Zickus <dzickus@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: [PATCH 01/16] perf top: Consider PERF_RECORD_ events with cpumode == 0

From: Arnaldo Carvalho de Melo <acme@...hat.com>

Some events (PERF_RECORD_COMM,EXEC,EXIT,etc) don't set
perf_event_attr.misc with the PERF_RECORD_MISC_ bits in
PERF_RECORD_MISC_CPUMODE_MASK, and were being discarded, for those we
need just to set the machine to be used to be machines.host.

Even with those events not being considered 'top' worked because it
would create thread structs by means of machine__findnew_thread() when
processing a sample or PERF_RECORD_MMAP event, that sets the field to
PERF_RECORD_MISC_USER, and thus we could find the DSO where samples took
place, resolve IPs to symbols, etc.

But the effect was that the threads would remain in machines->threads
forever, slowly using more and more memory and making the thread lookup
to take longer than needed, fix it.

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: Namhyung Kim <namhyung@...nel.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-pzzsmdr4ljsso771ul83ij1f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-top.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1cb3436276d1..67349fdc51d8 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -832,6 +832,12 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
 			++top->kernel_samples;
 			if (top->hide_kernel_symbols)
 				goto next_event;
+			/* Fall thru */
+		default:
+			/*
+			 * For events that don't set the cpumode, like:
+			 * PERF_RECORD_{COMM,FORK,EXIT,THROTTLE,UNTHROTTLE}
+			 */
 			machine = &session->machines.host;
 			break;
 		case PERF_RECORD_MISC_GUEST_KERNEL:
@@ -845,8 +851,6 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
 			 * TODO: we don't process guest user from host side
 			 * except simple counting.
 			 */
-			/* Fall thru */
-		default:
 			goto next_event;
 		}
 
-- 
1.9.3

--
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