• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/tools/perf/

Lines Matching refs:counter

12     Performance counter stats for '/home/mingo/hackbench':
144 #define MATCH_EVENT(t, c, counter) \
145 (attrs[counter].type == PERF_TYPE_##t && \
146 attrs[counter].config == PERF_COUNT_##c)
149 "Error: counter %d, sys_perf_event_open() syscall returned with %d (%s)\n"
151 static int create_perf_stat_counter(int counter)
153 struct perf_event_attr *attr = attrs + counter;
165 fd[cpu][counter][0] = sys_perf_event_open(attr,
167 if (fd[cpu][counter][0] < 0)
168 pr_debug(ERR_PERF_OPEN, counter,
169 fd[cpu][counter][0], strerror(errno));
180 fd[0][counter][thread] = sys_perf_event_open(attr,
182 if (fd[0][counter][thread] < 0)
183 pr_debug(ERR_PERF_OPEN, counter,
184 fd[0][counter][thread],
195 * Does the counter have nsecs as a unit?
197 static inline int nsec_counter(int counter)
199 if (MATCH_EVENT(SOFTWARE, SW_CPU_CLOCK, counter) ||
200 MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter))
207 * Read out the results of a single counter:
209 static void read_counter(int counter)
222 if (fd[cpu][counter][thread] < 0)
225 res = read(fd[cpu][counter][thread],
229 close(fd[cpu][counter][thread]);
230 fd[cpu][counter][thread] = -1;
243 event_scaled[counter] = -1;
249 event_scaled[counter] = 1;
256 update_stats(&event_res_stats[counter][i], count[i]);
259 fprintf(stderr, "%s: %Ld %Ld %Ld\n", event_name(counter),
266 if (MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter))
268 if (MATCH_EVENT(HARDWARE, HW_CPU_CYCLES, counter))
270 if (MATCH_EVENT(HARDWARE, HW_BRANCH_INSTRUCTIONS, counter))
278 int counter, ncreated = 0;
337 for (counter = 0; counter < nr_counters; counter++)
338 ncreated += create_perf_stat_counter(counter);
365 for (counter = 0; counter < nr_counters; counter++)
366 read_counter(counter);
371 static void print_noise(int counter, double avg)
377 100 * stddev_stats(&event_res_stats[counter][0]) / avg);
380 static void nsec_printout(int counter, double avg)
384 fprintf(stderr, " %18.6f %-24s", msecs, event_name(counter));
386 if (MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter)) {
392 static void abs_printout(int counter, double avg)
397 fprintf(stderr, " %'18.0f %-24s", avg, event_name(counter));
399 fprintf(stderr, " %18.0f %-24s", avg, event_name(counter));
401 if (MATCH_EVENT(HARDWARE, HW_INSTRUCTIONS, counter)) {
408 } else if (MATCH_EVENT(HARDWARE, HW_BRANCH_MISSES, counter) &&
428 * Print out the results of a single counter:
430 static void print_counter(int counter)
432 double avg = avg_stats(&event_res_stats[counter][0]);
433 int scaled = event_scaled[counter];
437 "<not counted>", event_name(counter));
441 if (nsec_counter(counter))
442 nsec_printout(counter, avg);
444 abs_printout(counter, avg);
446 print_noise(counter, avg);
451 avg_enabled = avg_stats(&event_res_stats[counter][1]);
452 avg_running = avg_stats(&event_res_stats[counter][2]);
463 int i, counter;
468 fprintf(stderr, " Performance counter stats for ");
483 for (counter = 0; counter < nr_counters; counter++)
484 print_counter(counter);
539 "be more verbose (show counter open errors, etc)"),