diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 65 |
1 files changed, 2 insertions, 63 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index d8e622dd738a..dd5f058292d8 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -2648,63 +2648,8 @@ static void print_lat_fmt(void *data, int size __unused) | |||
2648 | printf("%d", lock_depth); | 2648 | printf("%d", lock_depth); |
2649 | } | 2649 | } |
2650 | 2650 | ||
2651 | /* taken from Linux, written by Frederic Weisbecker */ | ||
2652 | static void print_graph_cpu(int cpu) | ||
2653 | { | ||
2654 | int i; | ||
2655 | int log10_this = log10_cpu(cpu); | ||
2656 | int log10_all = log10_cpu(cpus); | ||
2657 | |||
2658 | |||
2659 | /* | ||
2660 | * Start with a space character - to make it stand out | ||
2661 | * to the right a bit when trace output is pasted into | ||
2662 | * email: | ||
2663 | */ | ||
2664 | printf(" "); | ||
2665 | |||
2666 | /* | ||
2667 | * Tricky - we space the CPU field according to the max | ||
2668 | * number of online CPUs. On a 2-cpu system it would take | ||
2669 | * a maximum of 1 digit - on a 128 cpu system it would | ||
2670 | * take up to 3 digits: | ||
2671 | */ | ||
2672 | for (i = 0; i < log10_all - log10_this; i++) | ||
2673 | printf(" "); | ||
2674 | |||
2675 | printf("%d) ", cpu); | ||
2676 | } | ||
2677 | |||
2678 | #define TRACE_GRAPH_PROCINFO_LENGTH 14 | ||
2679 | #define TRACE_GRAPH_INDENT 2 | 2651 | #define TRACE_GRAPH_INDENT 2 |
2680 | 2652 | ||
2681 | static void print_graph_proc(int pid, const char *comm) | ||
2682 | { | ||
2683 | /* sign + log10(MAX_INT) + '\0' */ | ||
2684 | char pid_str[11]; | ||
2685 | int spaces = 0; | ||
2686 | int len; | ||
2687 | int i; | ||
2688 | |||
2689 | sprintf(pid_str, "%d", pid); | ||
2690 | |||
2691 | /* 1 stands for the "-" character */ | ||
2692 | len = strlen(comm) + strlen(pid_str) + 1; | ||
2693 | |||
2694 | if (len < TRACE_GRAPH_PROCINFO_LENGTH) | ||
2695 | spaces = TRACE_GRAPH_PROCINFO_LENGTH - len; | ||
2696 | |||
2697 | /* First spaces to align center */ | ||
2698 | for (i = 0; i < spaces / 2; i++) | ||
2699 | printf(" "); | ||
2700 | |||
2701 | printf("%s-%s", comm, pid_str); | ||
2702 | |||
2703 | /* Last spaces to align center */ | ||
2704 | for (i = 0; i < spaces - (spaces / 2); i++) | ||
2705 | printf(" "); | ||
2706 | } | ||
2707 | |||
2708 | static struct record * | 2653 | static struct record * |
2709 | get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func, | 2654 | get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func, |
2710 | struct record *next) | 2655 | struct record *next) |
@@ -2876,7 +2821,7 @@ static void print_graph_nested(struct event *event, void *data) | |||
2876 | 2821 | ||
2877 | static void | 2822 | static void |
2878 | pretty_print_func_ent(void *data, int size, struct event *event, | 2823 | pretty_print_func_ent(void *data, int size, struct event *event, |
2879 | int cpu, int pid, const char *comm, | 2824 | int cpu, int pid, const char *comm __unused, |
2880 | unsigned long secs, unsigned long usecs) | 2825 | unsigned long secs, unsigned long usecs) |
2881 | { | 2826 | { |
2882 | struct format_field *field; | 2827 | struct format_field *field; |
@@ -2886,9 +2831,6 @@ pretty_print_func_ent(void *data, int size, struct event *event, | |||
2886 | 2831 | ||
2887 | printf("%5lu.%06lu | ", secs, usecs); | 2832 | printf("%5lu.%06lu | ", secs, usecs); |
2888 | 2833 | ||
2889 | print_graph_cpu(cpu); | ||
2890 | print_graph_proc(pid, comm); | ||
2891 | |||
2892 | printf(" | "); | 2834 | printf(" | "); |
2893 | 2835 | ||
2894 | if (latency_format) { | 2836 | if (latency_format) { |
@@ -2924,7 +2866,7 @@ out_free: | |||
2924 | 2866 | ||
2925 | static void | 2867 | static void |
2926 | pretty_print_func_ret(void *data, int size __unused, struct event *event, | 2868 | pretty_print_func_ret(void *data, int size __unused, struct event *event, |
2927 | int cpu, int pid, const char *comm, | 2869 | int cpu __unused, int pid __unused, const char *comm __unused, |
2928 | unsigned long secs, unsigned long usecs) | 2870 | unsigned long secs, unsigned long usecs) |
2929 | { | 2871 | { |
2930 | unsigned long long rettime, calltime; | 2872 | unsigned long long rettime, calltime; |
@@ -2934,9 +2876,6 @@ pretty_print_func_ret(void *data, int size __unused, struct event *event, | |||
2934 | 2876 | ||
2935 | printf("%5lu.%06lu | ", secs, usecs); | 2877 | printf("%5lu.%06lu | ", secs, usecs); |
2936 | 2878 | ||
2937 | print_graph_cpu(cpu); | ||
2938 | print_graph_proc(pid, comm); | ||
2939 | |||
2940 | printf(" | "); | 2879 | printf(" | "); |
2941 | 2880 | ||
2942 | if (latency_format) { | 2881 | if (latency_format) { |