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]
Date:   Fri, 16 Aug 2019 13:54:24 -0700
From:   tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     fweimer@...hat.com, linux-kernel@...r.kernel.org,
        wcohen@...hat.com, tglx@...utronix.de, namhyung@...nel.org,
        mingo@...nel.org, adrian.hunter@...el.com, acme@...hat.com,
        jolsa@...nel.org, hpa@...or.com
Subject: [tip:perf/core] perf evswitch: Introduce OPTS_EVSWITCH() for cmd
 line processing

Commit-ID:  add3a719c95f0443d563889b4af255b78ba54521
Gitweb:     https://git.kernel.org/tip/add3a719c95f0443d563889b4af255b78ba54521
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Thu, 15 Aug 2019 11:21:21 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 15 Aug 2019 12:25:47 -0300

perf evswitch: Introduce OPTS_EVSWITCH() for cmd line processing

All tools will want those, so provide a convenient way to get them.

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Florian Weimer <fweimer@...hat.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: William Cohen <wcohen@...hat.com>
Link: https://lkml.kernel.org/n/tip-v16pe3sbf3wjmn152u18f649@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-script.c | 7 +------
 tools/perf/util/evswitch.h  | 8 ++++++++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 177e4e91b199..2a5b8af80e6b 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -3543,12 +3543,7 @@ int cmd_script(int argc, const char **argv)
 		   "file", "file saving guest os /proc/kallsyms"),
 	OPT_STRING(0, "guestmodules", &symbol_conf.default_guest_modules,
 		   "file", "file saving guest os /proc/modules"),
-	OPT_STRING(0, "switch-on", &script.evswitch.on_name,
-		   "event", "Consider events after the ocurrence of this event"),
-	OPT_STRING(0, "switch-off", &script.evswitch.off_name,
-		   "event", "Stop considering events after the ocurrence of this event"),
-	OPT_BOOLEAN(0, "show-on-off-events", &script.evswitch.show_on_off_events,
-		    "Show the on/off switch events, used with --switch-on"),
+	OPTS_EVSWITCH(&script.evswitch),
 	OPT_END()
 	};
 	const char * const script_subcommands[] = { "record", "report", NULL };
diff --git a/tools/perf/util/evswitch.h b/tools/perf/util/evswitch.h
index 891164504080..94220d1bb479 100644
--- a/tools/perf/util/evswitch.h
+++ b/tools/perf/util/evswitch.h
@@ -16,4 +16,12 @@ struct evswitch {
 
 bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel);
 
+#define OPTS_EVSWITCH(evswitch)								  \
+	OPT_STRING(0, "switch-on", &(evswitch)->on_name,				  \
+		   "event", "Consider events after the ocurrence of this event"),	  \
+	OPT_STRING(0, "switch-off", &(evswitch)->off_name,				  \
+		   "event", "Stop considering events after the ocurrence of this event"), \
+	OPT_BOOLEAN(0, "show-on-off-events", &(evswitch)->show_on_off_events,		  \
+		    "Show the on/off switch events, used with --switch-on and --switch-off")
+
 #endif /* __PERF_EVSWITCH_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ