Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277329
b: refs/heads/master
c: 317df65
h: refs/heads/master
i:
  277327: 848e66f
v: v3
  • Loading branch information
Robert Richter authored and Arnaldo Carvalho de Melo committed Dec 12, 2011
1 parent 78576b5 commit 8ff91f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38efb539c13f8f173e381435cdd40463ab5d38de
refs/heads/master: 317df650c588bb9091b1fa0b5d726fe485aad88e
15 changes: 10 additions & 5 deletions trunk/tools/perf/builtin-script.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static u64 nr_unordered;
extern const struct option record_options[];
static bool no_callchain;
static bool show_full_info;
static bool system_wide;
static const char *cpu_list;
static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);

Expand Down Expand Up @@ -1105,6 +1106,8 @@ static const struct option options[] = {
OPT_CALLBACK('f', "fields", NULL, "str",
"comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr",
parse_output_fields),
OPT_BOOLEAN('a', "all-cpus", &system_wide,
"system-wide collection from all CPUs"),
OPT_STRING('C', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
OPT_STRING('c', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
"only display events for these comms"),
Expand Down Expand Up @@ -1134,7 +1137,6 @@ int cmd_script(int argc, const char **argv, const char *prefix __used)
struct perf_session *session;
char *script_path = NULL;
const char **__argv;
bool system_wide;
int i, j, err;

setup_scripting();
Expand Down Expand Up @@ -1202,15 +1204,17 @@ int cmd_script(int argc, const char **argv, const char *prefix __used)
}

if (!pid) {
system_wide = true;
j = 0;

dup2(live_pipe[1], 1);
close(live_pipe[0]);

if (!is_top_script(argv[0]))
if (is_top_script(argv[0])) {
system_wide = true;
} else if (!system_wide) {
system_wide = !have_cmd(argc - rep_args,
&argv[rep_args]);
}

__argv = malloc((argc + 6) * sizeof(const char *));
if (!__argv)
Expand Down Expand Up @@ -1258,10 +1262,11 @@ int cmd_script(int argc, const char **argv, const char *prefix __used)
script_path = rep_script_path;

if (script_path) {
system_wide = false;
j = 0;

if (rec_script_path)
if (!rec_script_path)
system_wide = false;
else if (!system_wide)
system_wide = !have_cmd(argc - 1, &argv[1]);

__argv = malloc((argc + 2) * sizeof(const char *));
Expand Down

0 comments on commit 8ff91f7

Please sign in to comment.