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-next>] [day] [month] [year] [list]
Message-Id: <1474222699-28969-1-git-send-email-andi@firstfloor.org>
Date:   Sun, 18 Sep 2016 11:18:18 -0700
From:   Andi Kleen <andi@...stfloor.org>
To:     acme@...nel.org
Cc:     jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 1/2] perf, tools, list: Print aliases with --raw-dump

From: Andi Kleen <ak@...ux.intel.com>

Print aliases like 'cycles' with perf list --raw-dump, so that
they can be completed by perf-completion.sh

Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 tools/perf/util/parse-events.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 94846271cb1c..9716c2bc6869 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2191,13 +2191,21 @@ restart:
 
 		if (!evt_num_known) {
 			evt_num++;
+			if (strlen(syms->alias))
+				evt_num++;
 			continue;
 		}
 
 		if (!name_only && strlen(syms->alias))
 			snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias);
-		else
+		else {
+			if (strlen(syms->alias)) {
+				evt_list[evt_i++] = strdup(syms->alias);
+				if (evt_list[evt_i - 1]  == NULL)
+					goto out_enomem;
+			}
 			strncpy(name, syms->symbol, MAX_NAME_LEN);
+		}
 
 		evt_list[evt_i] = strdup(name);
 		if (evt_list[evt_i] == NULL)
-- 
2.5.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ