builtin-script.c (7e66eaf14e19c032433be7c4df3c892fa2a5282f) builtin-script.c (fbe96f29ce4b33e0a22219cc7f5996d9157717e3)
1#include "builtin.h"
2
3#include "perf.h"
4#include "util/cache.h"
5#include "util/debug.h"
6#include "util/exec_cmd.h"
7#include "util/header.h"
8#include "util/parse-options.h"

--- 8 unchanged lines hidden (view full) ---

17
18static char const *script_name;
19static char const *generate_script_lang;
20static bool debug_mode;
21static u64 last_timestamp;
22static u64 nr_unordered;
23extern const struct option record_options[];
24static bool no_callchain;
1#include "builtin.h"
2
3#include "perf.h"
4#include "util/cache.h"
5#include "util/debug.h"
6#include "util/exec_cmd.h"
7#include "util/header.h"
8#include "util/parse-options.h"

--- 8 unchanged lines hidden (view full) ---

17
18static char const *script_name;
19static char const *generate_script_lang;
20static bool debug_mode;
21static u64 last_timestamp;
22static u64 nr_unordered;
23extern const struct option record_options[];
24static bool no_callchain;
25static bool show_full_info;
25static const char *cpu_list;
26static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
27
28enum perf_output_field {
29 PERF_OUTPUT_COMM = 1U << 0,
30 PERF_OUTPUT_TID = 1U << 1,
31 PERF_OUTPUT_PID = 1U << 2,
32 PERF_OUTPUT_TIME = 1U << 3,

--- 1045 unchanged lines hidden (view full) ---

1078 OPT_BOOLEAN('G', "hide-call-graph", &no_callchain,
1079 "When printing symbols do not display call chain"),
1080 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
1081 "Look for files with symbols relative to this directory"),
1082 OPT_CALLBACK('f', "fields", NULL, "str",
1083 "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",
1084 parse_output_fields),
1085 OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
26static const char *cpu_list;
27static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
28
29enum perf_output_field {
30 PERF_OUTPUT_COMM = 1U << 0,
31 PERF_OUTPUT_TID = 1U << 1,
32 PERF_OUTPUT_PID = 1U << 2,
33 PERF_OUTPUT_TIME = 1U << 3,

--- 1045 unchanged lines hidden (view full) ---

1079 OPT_BOOLEAN('G', "hide-call-graph", &no_callchain,
1080 "When printing symbols do not display call chain"),
1081 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
1082 "Look for files with symbols relative to this directory"),
1083 OPT_CALLBACK('f', "fields", NULL, "str",
1084 "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",
1085 parse_output_fields),
1086 OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
1086
1087 OPT_BOOLEAN('I', "show-info", &show_full_info,
1088 "display extended information from perf.data file"),
1087 OPT_END()
1088};
1089
1090static bool have_cmd(int argc, const char **argv)
1091{
1092 char **__argv = malloc(sizeof(const char *) * argc);
1093
1094 if (!__argv)

--- 168 unchanged lines hidden (view full) ---

1263 if (session == NULL)
1264 return -ENOMEM;
1265
1266 if (cpu_list) {
1267 if (perf_session__cpu_bitmap(session, cpu_list, cpu_bitmap))
1268 return -1;
1269 }
1270
1089 OPT_END()
1090};
1091
1092static bool have_cmd(int argc, const char **argv)
1093{
1094 char **__argv = malloc(sizeof(const char *) * argc);
1095
1096 if (!__argv)

--- 168 unchanged lines hidden (view full) ---

1265 if (session == NULL)
1266 return -ENOMEM;
1267
1268 if (cpu_list) {
1269 if (perf_session__cpu_bitmap(session, cpu_list, cpu_bitmap))
1270 return -1;
1271 }
1272
1273 perf_session__fprintf_info(session, stdout, show_full_info);
1274
1271 if (!no_callchain)
1272 symbol_conf.use_callchain = true;
1273 else
1274 symbol_conf.use_callchain = false;
1275
1276 if (generate_script_lang) {
1277 struct stat perf_stat;
1278 int input;

--- 53 unchanged lines hidden ---
1275 if (!no_callchain)
1276 symbol_conf.use_callchain = true;
1277 else
1278 symbol_conf.use_callchain = false;
1279
1280 if (generate_script_lang) {
1281 struct stat perf_stat;
1282 int input;

--- 53 unchanged lines hidden ---