evsel_fprintf.c (a8763445f6c78628bd96d51649745065c0bb2c92) evsel_fprintf.c (69b7e48070ca2ecee7498166259b5826b22e8b2e)
1#include <stdio.h>
2#include <stdbool.h>
3#include <traceevent/event-parse.h>
4#include "evsel.h"
5#include "callchain.h"
6#include "map.h"
7#include "symbol.h"
8

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

103 struct callchain_cursor_node *node;
104 int print_ip = print_opts & EVSEL__PRINT_IP;
105 int print_sym = print_opts & EVSEL__PRINT_SYM;
106 int print_dso = print_opts & EVSEL__PRINT_DSO;
107 int print_symoffset = print_opts & EVSEL__PRINT_SYMOFFSET;
108 int print_oneline = print_opts & EVSEL__PRINT_ONELINE;
109 int print_srcline = print_opts & EVSEL__PRINT_SRCLINE;
110 int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR;
1#include <stdio.h>
2#include <stdbool.h>
3#include <traceevent/event-parse.h>
4#include "evsel.h"
5#include "callchain.h"
6#include "map.h"
7#include "symbol.h"
8

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

103 struct callchain_cursor_node *node;
104 int print_ip = print_opts & EVSEL__PRINT_IP;
105 int print_sym = print_opts & EVSEL__PRINT_SYM;
106 int print_dso = print_opts & EVSEL__PRINT_DSO;
107 int print_symoffset = print_opts & EVSEL__PRINT_SYMOFFSET;
108 int print_oneline = print_opts & EVSEL__PRINT_ONELINE;
109 int print_srcline = print_opts & EVSEL__PRINT_SRCLINE;
110 int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR;
111 int print_arrow = print_opts & EVSEL__PRINT_CALLCHAIN_ARROW;
111 char s = print_oneline ? ' ' : '\t';
112 char s = print_oneline ? ' ' : '\t';
113 bool first = true;
112
113 if (sample->callchain) {
114 struct addr_location node_al;
115
116 callchain_cursor_commit(cursor);
117
118 while (1) {
119 u64 addr = 0;
120
121 node = callchain_cursor_current(cursor);
122 if (!node)
123 break;
124
125 printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " ");
126
114
115 if (sample->callchain) {
116 struct addr_location node_al;
117
118 callchain_cursor_commit(cursor);
119
120 while (1) {
121 u64 addr = 0;
122
123 node = callchain_cursor_current(cursor);
124 if (!node)
125 break;
126
127 printed += fprintf(fp, "%-*.*s", left_alignment, left_alignment, " ");
128
129 if (print_arrow && !first)
130 printed += fprintf(fp, " <-");
131
127 if (print_ip)
128 printed += fprintf(fp, "%c%16" PRIx64, s, node->ip);
129
130 if (node->map)
131 addr = node->map->map_ip(node->map, node->ip);
132
133 if (print_sym) {
134 printed += fprintf(fp, " ");

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

153
154 if (print_srcline)
155 printed += map__fprintf_srcline(node->map, addr, "\n ", fp);
156
157 if (!print_oneline)
158 printed += fprintf(fp, "\n");
159
160 callchain_cursor_advance(cursor);
132 if (print_ip)
133 printed += fprintf(fp, "%c%16" PRIx64, s, node->ip);
134
135 if (node->map)
136 addr = node->map->map_ip(node->map, node->ip);
137
138 if (print_sym) {
139 printed += fprintf(fp, " ");

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

158
159 if (print_srcline)
160 printed += map__fprintf_srcline(node->map, addr, "\n ", fp);
161
162 if (!print_oneline)
163 printed += fprintf(fp, "\n");
164
165 callchain_cursor_advance(cursor);
166 first = false;
161 }
162 }
163
164 return printed;
165}
166
167int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
168 int left_alignment, unsigned int print_opts,

--- 43 unchanged lines hidden ---
167 }
168 }
169
170 return printed;
171}
172
173int sample__fprintf_sym(struct perf_sample *sample, struct addr_location *al,
174 int left_alignment, unsigned int print_opts,

--- 43 unchanged lines hidden ---