builtin-trace.c (99ff7150547382ee612c40d8d6a0670ddec7c9fc) builtin-trace.c (fd2eabaf16984bc75695e43f4b76e6f20ed4ea41)
1#include <traceevent/event-parse.h>
2#include "builtin.h"
3#include "util/color.h"
4#include "util/debug.h"
5#include "util/evlist.h"
6#include "util/machine.h"
7#include "util/session.h"
8#include "util/thread.h"

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

1163 bool not_ev_qualifier;
1164 bool live;
1165 const char *last_vfs_getname;
1166 struct intlist *tid_list;
1167 struct intlist *pid_list;
1168 bool sched;
1169 bool multiple_threads;
1170 bool summary;
1#include <traceevent/event-parse.h>
2#include "builtin.h"
3#include "util/color.h"
4#include "util/debug.h"
5#include "util/evlist.h"
6#include "util/machine.h"
7#include "util/session.h"
8#include "util/thread.h"

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

1163 bool not_ev_qualifier;
1164 bool live;
1165 const char *last_vfs_getname;
1166 struct intlist *tid_list;
1167 struct intlist *pid_list;
1168 bool sched;
1169 bool multiple_threads;
1170 bool summary;
1171 bool summary_only;
1171 bool show_comm;
1172 bool show_tool_stats;
1173 double duration_filter;
1174 double runtime_ms;
1175 struct {
1176 u64 vfs_getname, proc_getname;
1177 } stats;
1178};

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

1606 ttrace->entry_time = sample->time;
1607 msg = ttrace->entry_str;
1608 printed += scnprintf(msg + printed, 1024 - printed, "%s(", sc->name);
1609
1610 printed += syscall__scnprintf_args(sc, msg + printed, 1024 - printed,
1611 args, trace, thread);
1612
1613 if (!strcmp(sc->name, "exit_group") || !strcmp(sc->name, "exit")) {
1172 bool show_comm;
1173 bool show_tool_stats;
1174 double duration_filter;
1175 double runtime_ms;
1176 struct {
1177 u64 vfs_getname, proc_getname;
1178 } stats;
1179};

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

1607 ttrace->entry_time = sample->time;
1608 msg = ttrace->entry_str;
1609 printed += scnprintf(msg + printed, 1024 - printed, "%s(", sc->name);
1610
1611 printed += syscall__scnprintf_args(sc, msg + printed, 1024 - printed,
1612 args, trace, thread);
1613
1614 if (!strcmp(sc->name, "exit_group") || !strcmp(sc->name, "exit")) {
1614 if (!trace->duration_filter) {
1615 if (!trace->duration_filter && !trace->summary_only) {
1615 trace__fprintf_entry_head(trace, thread, 1, sample->time, trace->output);
1616 fprintf(trace->output, "%-70s\n", ttrace->entry_str);
1617 }
1618 } else
1619 ttrace->entry_pending = true;
1620
1621 return 0;
1622}

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

1659
1660 if (ttrace->entry_time) {
1661 duration = sample->time - ttrace->entry_time;
1662 if (trace__filter_duration(trace, duration))
1663 goto out;
1664 } else if (trace->duration_filter)
1665 goto out;
1666
1616 trace__fprintf_entry_head(trace, thread, 1, sample->time, trace->output);
1617 fprintf(trace->output, "%-70s\n", ttrace->entry_str);
1618 }
1619 } else
1620 ttrace->entry_pending = true;
1621
1622 return 0;
1623}

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

1660
1661 if (ttrace->entry_time) {
1662 duration = sample->time - ttrace->entry_time;
1663 if (trace__filter_duration(trace, duration))
1664 goto out;
1665 } else if (trace->duration_filter)
1666 goto out;
1667
1668 if (trace->summary_only)
1669 goto out;
1670
1667 trace__fprintf_entry_head(trace, thread, duration, sample->time, trace->output);
1668
1669 if (ttrace->entry_pending) {
1670 fprintf(trace->output, "%-70s", ttrace->entry_str);
1671 } else {
1672 fprintf(trace->output, " ... [");
1673 color_fprintf(trace->output, PERF_COLOR_YELLOW, "continued");
1674 fprintf(trace->output, "]: %s()", sc->name);

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

2277 "user to profile"),
2278 OPT_CALLBACK(0, "duration", &trace, "float",
2279 "show only events with duration > N.M ms",
2280 trace__set_duration),
2281 OPT_BOOLEAN(0, "sched", &trace.sched, "show blocking scheduler events"),
2282 OPT_INCR('v', "verbose", &verbose, "be more verbose"),
2283 OPT_BOOLEAN('T', "time", &trace.full_time,
2284 "Show full timestamp, not time relative to first start"),
1671 trace__fprintf_entry_head(trace, thread, duration, sample->time, trace->output);
1672
1673 if (ttrace->entry_pending) {
1674 fprintf(trace->output, "%-70s", ttrace->entry_str);
1675 } else {
1676 fprintf(trace->output, " ... [");
1677 color_fprintf(trace->output, PERF_COLOR_YELLOW, "continued");
1678 fprintf(trace->output, "]: %s()", sc->name);

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

2281 "user to profile"),
2282 OPT_CALLBACK(0, "duration", &trace, "float",
2283 "show only events with duration > N.M ms",
2284 trace__set_duration),
2285 OPT_BOOLEAN(0, "sched", &trace.sched, "show blocking scheduler events"),
2286 OPT_INCR('v', "verbose", &verbose, "be more verbose"),
2287 OPT_BOOLEAN('T', "time", &trace.full_time,
2288 "Show full timestamp, not time relative to first start"),
2285 OPT_BOOLEAN(0, "summary", &trace.summary,
2286 "Show syscall summary with statistics"),
2289 OPT_BOOLEAN('s', "summary", &trace.summary_only,
2290 "Show only syscall summary with statistics"),
2291 OPT_BOOLEAN('S', "with-summary", &trace.summary,
2292 "Show all syscalls and summary with statistics"),
2287 OPT_END()
2288 };
2289 int err;
2290 char bf[BUFSIZ];
2291
2292 if ((argc > 1) && (strcmp(argv[1], "record") == 0))
2293 return trace__record(argc-2, &argv[2]);
2294
2295 argc = parse_options(argc, argv, trace_options, trace_usage, 0);
2296
2293 OPT_END()
2294 };
2295 int err;
2296 char bf[BUFSIZ];
2297
2298 if ((argc > 1) && (strcmp(argv[1], "record") == 0))
2299 return trace__record(argc-2, &argv[2]);
2300
2301 argc = parse_options(argc, argv, trace_options, trace_usage, 0);
2302
2303 /* summary_only implies summary option, but don't overwrite summary if set */
2304 if (trace.summary_only)
2305 trace.summary = trace.summary_only;
2306
2297 if (output_name != NULL) {
2298 err = trace__open_output(&trace, output_name);
2299 if (err < 0) {
2300 perror("failed to create output file");
2301 goto out;
2302 }
2303 }
2304

--- 43 unchanged lines hidden ---
2307 if (output_name != NULL) {
2308 err = trace__open_output(&trace, output_name);
2309 if (err < 0) {
2310 perror("failed to create output file");
2311 goto out;
2312 }
2313 }
2314

--- 43 unchanged lines hidden ---