From: tzanussi@gmail.com
To: linux-kernel@vger.kernel.org
Cc: acme@ghostprotocols.net, mingo@elte.hu, fweisbec@gmail.com
Subject: [PATCH 3/7] perf record: make the record options available outside perf record
Date: Wed, 10 Nov 2010 12:10:20 -0600 [thread overview]
Message-ID: <1289412624-4772-4-git-send-email-tzanussi@gmail.com> (raw)
In-Reply-To: <1289412624-4772-1-git-send-email-tzanussi@gmail.com>
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Other perf commands that invoke perf record, such as perf trace, may
want to reuse the options used by perf record.
This makes them non-static and renames them to avoid clashes with
other 'options' variables.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Acked-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
---
tools/perf/builtin-record.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 4e75583..93bd2ff 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -790,7 +790,7 @@ static const char * const record_usage[] = {
static bool force, append_file;
-static const struct option options[] = {
+const struct option record_options[] = {
OPT_CALLBACK('e', "event", NULL, "event",
"event selector. use 'perf list' to list available events",
parse_events),
@@ -839,16 +839,16 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
{
int i, j, err = -ENOMEM;
- argc = parse_options(argc, argv, options, record_usage,
+ argc = parse_options(argc, argv, record_options, record_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (!argc && target_pid == -1 && target_tid == -1 &&
!system_wide && !cpu_list)
- usage_with_options(record_usage, options);
+ usage_with_options(record_usage, record_options);
if (force && append_file) {
fprintf(stderr, "Can't overwrite and append at the same time."
" You need to choose between -f and -A");
- usage_with_options(record_usage, options);
+ usage_with_options(record_usage, record_options);
} else if (append_file) {
write_mode = WRITE_APPEND;
} else {
@@ -871,8 +871,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
if (thread_num <= 0) {
fprintf(stderr, "Can't find all threads of pid %d\n",
target_pid);
- usage_with_options(record_usage, options);
+ usage_with_options(record_usage, record_options);
}
} else {
all_tids=malloc(sizeof(pid_t));
--
Tom Zanussi, Intel Open Source Technology Center
next prev parent reply other threads:[~2010-11-10 18:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 18:10 [PATCH 0/7] perf trace command-line cleanup, v2 tzanussi
2010-11-10 18:10 ` [PATCH 1/7] perf trace scripting: fix some small memory leaks and missing error checks tzanussi
2010-11-10 18:10 ` [PATCH 2/7] perf trace scripting: remove system-wide param from shell scripts tzanussi
2010-11-10 18:10 ` tzanussi [this message]
2010-11-10 18:10 ` [PATCH 4/7] perf trace record: handle commands correctly tzanussi
2010-11-10 18:10 ` [PATCH 5/7] perf trace: live-mode command-line cleanup tzanussi
2010-11-10 18:10 ` [PATCH 6/7] perf trace: update Documentation with new perf trace variants tzanussi
2010-11-10 18:10 ` [PATCH 7/7] perf trace: update usage tzanussi
2010-11-10 18:15 ` [PATCH 0/7] perf trace command-line cleanup, v2 Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2010-11-09 21:18 [PATCH 0/7] perf trace command-line cleanup tzanussi
2010-11-09 21:18 ` [PATCH 3/7] perf record: make the record options available outside perf record tzanussi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289412624-4772-4-git-send-email-tzanussi@gmail.com \
--to=tzanussi@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome