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: <4c066bb2.5cebd80a.19ec.45d8@mx.google.com>
Date:	Wed, 2 Jun 2010 16:31:01 +0200
From:	Stephane Eranian <eranian@...gle.com>
To:	linux-kernel@...r.kernel.org
Cc:	peterz@...radead.org, mingo@...e.hu, paulus@...ba.org,
	davem@...emloft.net, fweisbec@...il.com, acme@...radead.org,
	perfmon2-devel@...ts.sf.net, eranian@...il.com, eranian@...gle.com,
	tzanussi@...il.com
Subject: [PATCH] perf: avoid assertion for -p option in perf stat -a

It was possible to use perf stat in system-wide mode with -a
and still attach to a process (-p) or thread (-t). The issue
is that it is not possible to get a termination signal from
the attached task, thus the command never terminates.
Furthermore, passing -p -a was triggering the assertion in
read_counter().

This patch fixes the issue by aborting perf stat if the
parameters conflict.

Signed-off-by: Stephane Eranian <eranian@...gle.com>

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index a6b4d44..a3b6a5f 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -573,6 +573,14 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
 	else
 		nr_cpus = 1;
 
+	/*
+	 * a system-wide session cannot be delimited via an attachment
+	 * because we cannot get a termination notification.
+	 * It also triggers the assertion in read_counter()
+	 */
+	if (system_wide && (target_tid != -1 || target_pid != -1))
+		usage_with_options(stat_usage, options);
+
 	if (nr_cpus < 1)
 		usage_with_options(stat_usage, options);
 
--
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