|
@@ -913,7 +913,7 @@ static int grab_bb(u8 *buffer, u64 start, u64 end,
|
|
|
|
|
|
static int ip__fprintf_jump(uint64_t ip, struct branch_entry *en,
|
|
static int ip__fprintf_jump(uint64_t ip, struct branch_entry *en,
|
|
struct perf_insn *x, u8 *inbuf, int len,
|
|
struct perf_insn *x, u8 *inbuf, int len,
|
|
- int insn, FILE *fp)
|
|
|
|
|
|
+ int insn, FILE *fp, int *total_cycles)
|
|
{
|
|
{
|
|
int printed = fprintf(fp, "\t%016" PRIx64 "\t%-30s\t#%s%s%s%s", ip,
|
|
int printed = fprintf(fp, "\t%016" PRIx64 "\t%-30s\t#%s%s%s%s", ip,
|
|
dump_insn(x, ip, inbuf, len, NULL),
|
|
dump_insn(x, ip, inbuf, len, NULL),
|
|
@@ -922,7 +922,8 @@ static int ip__fprintf_jump(uint64_t ip, struct branch_entry *en,
|
|
en->flags.in_tx ? " INTX" : "",
|
|
en->flags.in_tx ? " INTX" : "",
|
|
en->flags.abort ? " ABORT" : "");
|
|
en->flags.abort ? " ABORT" : "");
|
|
if (en->flags.cycles) {
|
|
if (en->flags.cycles) {
|
|
- printed += fprintf(fp, " %d cycles", en->flags.cycles);
|
|
|
|
|
|
+ *total_cycles += en->flags.cycles;
|
|
|
|
+ printed += fprintf(fp, " %d cycles [%d]", en->flags.cycles, *total_cycles);
|
|
if (insn)
|
|
if (insn)
|
|
printed += fprintf(fp, " %.2f IPC", (float)insn / en->flags.cycles);
|
|
printed += fprintf(fp, " %.2f IPC", (float)insn / en->flags.cycles);
|
|
}
|
|
}
|
|
@@ -979,6 +980,7 @@ static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample,
|
|
u8 buffer[MAXBB];
|
|
u8 buffer[MAXBB];
|
|
unsigned off;
|
|
unsigned off;
|
|
struct symbol *lastsym = NULL;
|
|
struct symbol *lastsym = NULL;
|
|
|
|
+ int total_cycles = 0;
|
|
|
|
|
|
if (!(br && br->nr))
|
|
if (!(br && br->nr))
|
|
return 0;
|
|
return 0;
|
|
@@ -999,7 +1001,7 @@ static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample,
|
|
printed += ip__fprintf_sym(br->entries[nr - 1].from, thread,
|
|
printed += ip__fprintf_sym(br->entries[nr - 1].from, thread,
|
|
x.cpumode, x.cpu, &lastsym, attr, fp);
|
|
x.cpumode, x.cpu, &lastsym, attr, fp);
|
|
printed += ip__fprintf_jump(br->entries[nr - 1].from, &br->entries[nr - 1],
|
|
printed += ip__fprintf_jump(br->entries[nr - 1].from, &br->entries[nr - 1],
|
|
- &x, buffer, len, 0, fp);
|
|
|
|
|
|
+ &x, buffer, len, 0, fp, &total_cycles);
|
|
}
|
|
}
|
|
|
|
|
|
/* Print all blocks */
|
|
/* Print all blocks */
|
|
@@ -1027,7 +1029,8 @@ static int perf_sample__fprintf_brstackinsn(struct perf_sample *sample,
|
|
|
|
|
|
printed += ip__fprintf_sym(ip, thread, x.cpumode, x.cpu, &lastsym, attr, fp);
|
|
printed += ip__fprintf_sym(ip, thread, x.cpumode, x.cpu, &lastsym, attr, fp);
|
|
if (ip == end) {
|
|
if (ip == end) {
|
|
- printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, insn, fp);
|
|
|
|
|
|
+ printed += ip__fprintf_jump(ip, &br->entries[i], &x, buffer + off, len - off, insn, fp,
|
|
|
|
+ &total_cycles);
|
|
break;
|
|
break;
|
|
} else {
|
|
} else {
|
|
printed += fprintf(fp, "\t%016" PRIx64 "\t%s\n", ip,
|
|
printed += fprintf(fp, "\t%016" PRIx64 "\t%s\n", ip,
|