• Home
  • Raw
  • Download

Lines Matching full:trace

47 static int past_eof(struct trace *trace, char *cur)  in past_eof()  argument
49 if (cur >= trace->mpstat_start + trace->mpstat_len) in past_eof()
54 int next_mpstat_line(struct trace *trace) in next_mpstat_line() argument
57 char *cur = trace->mpstat_cur; in next_mpstat_line()
63 if (past_eof(trace, next)) in next_mpstat_line()
65 trace->mpstat_cur = next; in next_mpstat_line()
69 char *next_mpstat(struct trace *trace) in next_mpstat() argument
73 cur = strstr(trace->mpstat_cur, record_header); in next_mpstat()
77 cur = strstr(trace->mpstat_cur, record_header_v2); in next_mpstat()
84 if (past_eof(trace, cur)) in next_mpstat()
86 trace->mpstat_cur = cur; in next_mpstat()
90 char *first_mpstat(struct trace *trace) in first_mpstat() argument
92 char *cur = trace->mpstat_cur; in first_mpstat()
94 trace->mpstat_cur = trace->mpstat_start; in first_mpstat()
96 cur = next_mpstat(trace); in first_mpstat()
102 static void find_last_mpstat_time(struct trace *trace) in find_last_mpstat_time() argument
107 first_mpstat(trace); in find_last_mpstat_time()
109 cur = first_mpstat(trace); in find_last_mpstat_time()
112 cur = next_mpstat(trace); in find_last_mpstat_time()
114 first_mpstat(trace); in find_last_mpstat_time()
115 trace->mpstat_seconds = num_mpstats; in find_last_mpstat_time()
118 static int guess_mpstat_cpus(struct trace *trace) in guess_mpstat_cpus() argument
124 cur = first_mpstat(trace); in guess_mpstat_cpus()
129 ret = next_mpstat_line(trace); in guess_mpstat_cpus()
133 cur = trace->mpstat_cur; in guess_mpstat_cpus()
142 trace->mpstat_num_cpus = count - 1; in guess_mpstat_cpus()
146 static int count_mpstat_cpus(struct trace *trace) in count_mpstat_cpus() argument
148 char *cur = trace->mpstat_start; in count_mpstat_cpus()
153 first_mpstat(trace); in count_mpstat_cpus()
156 return guess_mpstat_cpus(trace); in count_mpstat_cpus()
170 trace->mpstat_num_cpus = atoi(cur); in count_mpstat_cpus()
171 first_mpstat(trace); in count_mpstat_cpus()
174 return trace->mpstat_num_cpus; in count_mpstat_cpus()
204 int read_mpstat(struct trace *trace, char *trace_name) in read_mpstat() argument
227 fprintf(stderr, "Unable to mmap trace file %s, err %s\n", line, strerror(errno)); in read_mpstat()
230 trace->mpstat_start = p; in read_mpstat()
231 trace->mpstat_len = st.st_size; in read_mpstat()
232 trace->mpstat_cur = p; in read_mpstat()
233 trace->mpstat_fd = fd; in read_mpstat()
234 find_last_mpstat_time(trace); in read_mpstat()
235 count_mpstat_cpus(trace); in read_mpstat()
237 first_mpstat(trace); in read_mpstat()
256 int read_mpstat_event(struct trace *trace, double *user, in read_mpstat_event() argument
260 char *cur = trace->mpstat_cur; in read_mpstat_event()
266 if (past_eof(trace, cur)) in read_mpstat_event()