23 #include <sys/types.h>
38 #define CORE_L2_MISS_CYCLES 200
39 #define CORE_L2_HIT_CYCLES 14.5
40 #define CORE_L1_DTLB_MISS_CYCLES 10
41 #define CORE_LCP_STALL_CYCLES 6
42 #define CORE_UNKNOWN_ADDR_STORE_CYCLES 5
43 #define CORE_OVERLAPPING_CYCLES 6
44 #define CORE_SPAN_ACROSS_CACHE_LINE_CYCLES 20
47 #define I7_L1_DTLB_WALK_COMPLETED_CYCLES 35
48 #define I7_L1_ITLB_WALK_COMPLETED_CYCLES 35
49 #define I7_L2_HIT_CYCLES 6
50 #define I7_L3_UNSHARED_HIT_CYCLES 35
51 #define I7_OTHER_CORE_L2_HIT_CYCLES 60
52 #define I7_OTHER_CORE_L2_HITM_CYCLES 75
53 #define I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES 225 //average of 200 (not modified) and 225-250 (modified)
54 #define I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES 360 //average of 350 (not modified) and 370 (modified)
55 #define I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES 180
56 #define I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT 200
57 #define I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT 350
58 #define I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP 35
59 #define I7_IFETCH_L2_MISS_L3_HIT_SNOOP 60
60 #define I7_IFETCH_L2_MISS_L3_HITM 75
61 #define I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD 180
63 #define MAX_MODULES 1000
65 #define EXPECTED_CPI 0.25
67 #define MAX_FILENAME_LENGTH 1024
68 #define MAX_SAMPLE_INDEX_LENGTH 10000
69 #define MAX_SYM_LENGTH 15000
70 #define MAX_SYM_MOD_LENGTH 20000
71 #define MAX_LIB_LENGTH 5000
72 #define MAX_LIB_MOD_LENGTH 7000
73 #define MAX_SIMPLE_SYM_LENGTH 300
74 #define MAX_SIMPLE_SYM_MOD_LENGTH 500
75 #define MAX_SIMPLE_LIB_LENGTH 300
76 #define MAX_SIMPLE_LIB_MOD_LENGTH 500
77 #define MAX_LINE_LENGTH 20000
78 #define MAX_EVENT_NAME_LENGTH 150
79 #define MAX_MODULE_NAME_LENGTH 250
80 #define MAX_VALUE_STRING_LENGTH 250
81 #define MAX_ARCH_NAME_LENGTH 20
82 #define MAX_CMASK_STR_LENGTH 5
83 #define MAX_INV_STR_LENGTH 5
84 #define MAX_SP_STR_LENGTH 50
86 #define PIPE_BUFFER_LENGTH 1000
93 pipe = popen(cmd,
"r");
96 printf(
"Cannot open pipe. Exiting...\n");
101 std::string result =
"";
110 iss =
new std::istringstream(result, std::istringstream::in);
134 if(!isspace(*srcbuffer++))
138 while(isspace(*srcbuffer))
142 *destbuffer = srcbuffer;
153 bool skipString(
const char *strptr,
const char *srcbuffer,
const char **dstbuffer)
155 if(strncmp(srcbuffer, strptr, strlen(strptr)))
159 *dstbuffer = srcbuffer + strlen(strptr);
185 if(i->OFFSET == offset)
187 return i->NAME.c_str();
197 return i->NAME.c_str();
235 std::string commandLine =
"objdump -p " +
NAME;
240 bool matched =
false;
241 while(objdump.output())
250 std::getline(objdump.output(),
line);
252 if(!objdump.output())
break;
253 if(line.empty())
continue;
254 const char *lineptr = line.c_str();
256 if(!
skipString(
"LOAD", lineptr, &lineptr))
continue;
258 if(!
skipString(
"off", lineptr, &lineptr))
continue;
260 int initialBase = strtol(lineptr, &endptr, 16);
261 if(lineptr == endptr)
continue;
264 if(!
skipString(
"vaddr", lineptr, &lineptr))
continue;
266 int finalBase = strtol(lineptr, &endptr, 16);
267 if(lineptr == endptr)
continue;
268 vmbase=finalBase - initialBase;
274 fprintf(stderr,
"Cannot determine VM base address for %s\n",
NAME.c_str());
275 fprintf(stderr,
"Error while running `objdump -p %s`\n",
NAME.c_str());
278 std::string commandLine2 =
"nm -t d -n " +
NAME;
283 std::getline(nm.output(),
line);
284 if(!nm.output())
break;
285 if(line.empty())
continue;
287 const char *begin = line.c_str();
289 int address = strtol(begin, &endptr, 10);
290 if(endptr == begin)
continue;
291 if(*endptr++ !=
' ')
continue;
292 if(isspace(*endptr++))
continue;
293 if(*endptr++ !=
' ')
continue;
294 char *symbolName = endptr;
295 while(*endptr && !isspace(*endptr)) endptr++;
296 if(*endptr != 0)
continue;
298 if(symbolName[0] ==
'.')
continue;
303 int offset = address-vmbase;
310 static std::map<std::string, unsigned int> modules_tot_samples;
311 static std::map<std::string, FileInfo> libsInfo;
314 static std::map<std::string, std::map<std::string, double> > C_modules;
315 static std::vector<std::string> C_events;
316 static std::vector<std::string> S_events;
318 static std::vector<std::string> core_caa_events;
319 static std::vector<std::string> nhm_caa_events;
320 static std::vector<std::string> core_caa_events_displ;
321 static std::vector<std::string> nhm_caa_events_displ;
325 core_caa_events.push_back(
"BRANCH_INSTRUCTIONS_RETIRED");
326 core_caa_events.push_back(
"ILD_STALL");
327 core_caa_events.push_back(
"INST_RETIRED:LOADS");
328 core_caa_events.push_back(
"INST_RETIRED:OTHER");
329 core_caa_events.push_back(
"INST_RETIRED:STORES");
330 core_caa_events.push_back(
"INSTRUCTIONS_RETIRED");
331 core_caa_events.push_back(
"LOAD_BLOCK:OVERLAP_STORE");
332 core_caa_events.push_back(
"LOAD_BLOCK:STA");
333 core_caa_events.push_back(
"LOAD_BLOCK:UNTIL_RETIRE");
334 core_caa_events.push_back(
"MEM_LOAD_RETIRED:DTLB_MISS");
335 core_caa_events.push_back(
"MEM_LOAD_RETIRED:L1D_LINE_MISS");
336 core_caa_events.push_back(
"MEM_LOAD_RETIRED:L2_LINE_MISS");
337 core_caa_events.push_back(
"MISPREDICTED_BRANCH_RETIRED");
340 core_caa_events.push_back(
"RS_UOPS_DISPATCHED CMASK=1 INV=1");
341 core_caa_events.push_back(
"SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE");
342 core_caa_events.push_back(
"UNHALTED_CORE_CYCLES");
350 nhm_caa_events.push_back(
"ARITH:CYCLES_DIV_BUSY");
351 nhm_caa_events.push_back(
"BR_INST_EXEC:ANY");
352 nhm_caa_events.push_back(
"BR_INST_EXEC:DIRECT_NEAR_CALL");
353 nhm_caa_events.push_back(
"BR_INST_EXEC:INDIRECT_NEAR_CALL");
354 nhm_caa_events.push_back(
"BR_INST_EXEC:INDIRECT_NON_CALL");
355 nhm_caa_events.push_back(
"BR_INST_EXEC:NEAR_CALLS");
356 nhm_caa_events.push_back(
"BR_INST_EXEC:NON_CALLS");
357 nhm_caa_events.push_back(
"BR_INST_EXEC:RETURN_NEAR");
358 nhm_caa_events.push_back(
"BR_INST_RETIRED:ALL_BRANCHES");
359 nhm_caa_events.push_back(
"BR_INST_RETIRED:CONDITIONAL");
360 nhm_caa_events.push_back(
"BR_INST_RETIRED:NEAR_CALL");
361 nhm_caa_events.push_back(
"BR_MISP_EXEC:ANY");
362 nhm_caa_events.push_back(
"CPU_CLK_UNHALTED:THREAD_P");
363 nhm_caa_events.push_back(
"DTLB_LOAD_MISSES:WALK_COMPLETED");
364 nhm_caa_events.push_back(
"INST_RETIRED:ANY_P");
365 nhm_caa_events.push_back(
"ITLB_MISSES:WALK_COMPLETED");
366 nhm_caa_events.push_back(
"L2_RQSTS:IFETCH_HIT");
367 nhm_caa_events.push_back(
"L2_RQSTS:IFETCH_MISS");
368 nhm_caa_events.push_back(
"MEM_INST_RETIRED:LOADS");
369 nhm_caa_events.push_back(
"MEM_INST_RETIRED:STORES");
370 nhm_caa_events.push_back(
"MEM_LOAD_RETIRED:L2_HIT");
371 nhm_caa_events.push_back(
"MEM_LOAD_RETIRED:L3_MISS");
372 nhm_caa_events.push_back(
"MEM_LOAD_RETIRED:L3_UNSHARED_HIT");
373 nhm_caa_events.push_back(
"MEM_LOAD_RETIRED:OTHER_CORE_L2_HIT_HITM");
374 nhm_caa_events.push_back(
"MEM_UNCORE_RETIRED:LOCAL_DRAM");
375 nhm_caa_events.push_back(
"MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM");
376 nhm_caa_events.push_back(
"MEM_UNCORE_RETIRED:REMOTE_CACHE_LOCAL_HOME_HIT");
377 nhm_caa_events.push_back(
"MEM_UNCORE_RETIRED:REMOTE_DRAM");
378 nhm_caa_events.push_back(
"OFFCORE_RESPONSE_0:DMND_IFETCH:LOCAL_DRAM");
379 nhm_caa_events.push_back(
"OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HITM");
380 nhm_caa_events.push_back(
"OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HIT_SNP");
381 nhm_caa_events.push_back(
"OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_CACHE_FWD");
382 nhm_caa_events.push_back(
"OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_DRAM");
383 nhm_caa_events.push_back(
"OFFCORE_RESPONSE_0:DMND_IFETCH:UNCORE_HIT");
384 nhm_caa_events.push_back(
"RESOURCE_STALLS:ANY");
385 nhm_caa_events.push_back(
"SSEX_UOPS_RETIRED:PACKED_DOUBLE");
386 nhm_caa_events.push_back(
"SSEX_UOPS_RETIRED:PACKED_SINGLE");
387 nhm_caa_events.push_back(
"UOPS_DECODED:MS CMASK=1");
388 nhm_caa_events.push_back(
"UOPS_ISSUED:ANY CMASK=1 INV=1");
389 nhm_caa_events.push_back(
"ITLB_MISS_RETIRED");
390 nhm_caa_events.push_back(
"UOPS_RETIRED:ANY");
395 for(std::vector<std::string>::const_iterator it=core_caa_events.begin(); it!=core_caa_events.end(); ++it)
397 if(find(C_events.begin(), C_events.end(), (*it))==C_events.end())
399 fprintf(stderr,
"ERROR: Cannot find event %s!!!\naborting...\n", (*it).c_str());
408 for(std::vector<std::string>::const_iterator it=nhm_caa_events.begin(); it!=nhm_caa_events.end(); ++it)
410 if(find(C_events.begin(), C_events.end(), (*it))==C_events.end())
412 fprintf(stderr,
"ERROR: Cannot find event %s!!!\naborting...\n", (*it).c_str());
421 core_caa_events_displ.push_back(
"Total Cycles");
422 core_caa_events_displ.push_back(
"Stalled Cycles");
423 core_caa_events_displ.push_back(
"% of Total Cycles");
424 core_caa_events_displ.push_back(
"Instructions Retired");
425 core_caa_events_displ.push_back(
"CPI");
426 core_caa_events_displ.push_back(
"");
427 core_caa_events_displ.push_back(
"iMargin");
428 core_caa_events_displ.push_back(
"iFactor");
429 core_caa_events_displ.push_back(
"");
430 core_caa_events_displ.push_back(
"Counted Stalled Cycles");
431 core_caa_events_displ.push_back(
"");
432 core_caa_events_displ.push_back(
"L2 Miss Impact");
433 core_caa_events_displ.push_back(
"L2 Miss % of counted Stalled Cycles");
434 core_caa_events_displ.push_back(
"");
435 core_caa_events_displ.push_back(
"L2 Hit Impact");
436 core_caa_events_displ.push_back(
"L2 Hit % of counted Stalled Cycles");
437 core_caa_events_displ.push_back(
"");
438 core_caa_events_displ.push_back(
"L1 DTLB Miss Impact");
439 core_caa_events_displ.push_back(
"L1 DTLB Miss % of counted Stalled Cycles");
440 core_caa_events_displ.push_back(
"");
441 core_caa_events_displ.push_back(
"LCP Stalls Impact");
442 core_caa_events_displ.push_back(
"LCP Stalls % of counted Stalled Cycles");
443 core_caa_events_displ.push_back(
"");
444 core_caa_events_displ.push_back(
"Store-Fwd Stalls Impact");
445 core_caa_events_displ.push_back(
"Store-Fwd Stalls % of counted Stalled Cycles");
446 core_caa_events_displ.push_back(
"");
447 core_caa_events_displ.push_back(
"Loads Blocked by Unknown Address Store Impact");
448 core_caa_events_displ.push_back(
"Loads Blocked % of Store-Fwd Stalls Cycles");
449 core_caa_events_displ.push_back(
"Loads Overlapped with Stores Impact");
450 core_caa_events_displ.push_back(
"Loads Overlapped % of Store-Fwd Stalls Cycles");
451 core_caa_events_displ.push_back(
"Loads Spanning across Cache Lines Impact");
452 core_caa_events_displ.push_back(
"Loads Spanning % of Store-Fwd Stalls Cycles");
453 core_caa_events_displ.push_back(
"");
454 core_caa_events_displ.push_back(
"Load Instructions");
455 core_caa_events_displ.push_back(
"Load % of all Instructions");
456 core_caa_events_displ.push_back(
"Store Instructions");
457 core_caa_events_displ.push_back(
"Store % of all Instructions");
458 core_caa_events_displ.push_back(
"Branch Instructions");
459 core_caa_events_displ.push_back(
"Branch % of all Instructions");
460 core_caa_events_displ.push_back(
"Packed SIMD Computational Instructions");
461 core_caa_events_displ.push_back(
"Packed SIMD % of all Instructions");
462 core_caa_events_displ.push_back(
"Other Instructions");
463 core_caa_events_displ.push_back(
"Other % of all Instructions");
464 core_caa_events_displ.push_back(
"");
465 core_caa_events_displ.push_back(
"ITLB Miss Rate in %");
466 core_caa_events_displ.push_back(
"% of Mispredicted Branches");
471 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
473 (it->second)[
"Total Cycles"] = (it->second)[
"UNHALTED_CORE_CYCLES"];
474 (it->second)[
"Stalled Cycles"] = (it->second)[
"RS_UOPS_DISPATCHED CMASK=1 INV=1"];
475 (it->second)[
"L2 Miss Impact"] = (it->second)[
"MEM_LOAD_RETIRED:L2_LINE_MISS"] *
CORE_L2_MISS_CYCLES;
476 (it->second)[
"L2 Hit Impact"] = ((it->second)[
"MEM_LOAD_RETIRED:L1D_LINE_MISS"] - (it->second)[
"MEM_LOAD_RETIRED:L2_LINE_MISS"]) *
CORE_L2_HIT_CYCLES;
480 (it->second)[
"Loads Overlapped with Stores Impact"] = (it->second)[
"LOAD_BLOCK:OVERLAP_STORE"] *
CORE_OVERLAPPING_CYCLES;
482 (it->second)[
"Store-Fwd Stalls Impact"] = (it->second)[
"Loads Blocked by Unknown Address Store Impact"] + (it->second)[
"Loads Overlapped with Stores Impact"] + (it->second)[
"Loads Spanning across Cache Lines Impact"];
483 (it->second)[
"Counted Stalled Cycles"] = (it->second)[
"L2 Miss Impact"] + (it->second)[
"L2 Hit Impact"] + (it->second)[
"LCP Stalls Impact"] + (it->second)[
"L1 DTLB Miss Impact"] + (it->second)[
"Store-Fwd Stalls Impact"];
484 (it->second)[
"Instructions Retired"] = (it->second)[
"INSTRUCTIONS_RETIRED"];
485 (it->second)[
"ITLB Miss Rate in %"] = ((it->second)[
"ITLB_MISS_RETIRED"]/(it->second)[
"INSTRUCTIONS_RETIRED"])*100;
486 (it->second)[
"Branch Instructions"] = (it->second)[
"BRANCH_INSTRUCTIONS_RETIRED"];
487 (it->second)[
"Load Instructions"] = (it->second)[
"INST_RETIRED:LOADS"];
488 (it->second)[
"Store Instructions"] = (it->second)[
"INST_RETIRED:STORES"];
489 (it->second)[
"Other Instructions"] = (it->second)[
"INST_RETIRED:OTHER"] - (it->second)[
"SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"] - (it->second)[
"BRANCH_INSTRUCTIONS_RETIRED"];
490 (it->second)[
"% of Mispredicted Branches"] = ((it->second)[
"MISPREDICTED_BRANCH_RETIRED"]/(it->second)[
"BRANCH_INSTRUCTIONS_RETIRED"])*100;
491 (it->second)[
"Packed SIMD Computational Instructions"] = (it->second)[
"SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"];
492 (it->second)[
"Counted Instructions Retired"] = (it->second)[
"Branch Instructions"] + (it->second)[
"Load Instructions"] + (it->second)[
"Store Instructions"] + (it->second)[
"Other Instructions"] + (it->second)[
"Packed SIMD Computational Instructions"];
493 (it->second)[
"CPI"] = (it->second)[
"UNHALTED_CORE_CYCLES"]/(it->second)[
"INSTRUCTIONS_RETIRED"];
495 double localPerformanceImprovement = (it->second)[
"CPI"]/
EXPECTED_CPI;
496 double cyclesAfterImprovement = (it->second)[
"UNHALTED_CORE_CYCLES"]/localPerformanceImprovement;
497 double totalCyclesAfterImprovement = totalCycles-(it->second)[
"UNHALTED_CORE_CYCLES"]+cyclesAfterImprovement;
498 (it->second)[
"iMargin"] = 100-(totalCyclesAfterImprovement/totalCycles)*100;
500 (it->second)[
"% of Total Cycles"] = (it->second)[
"RS_UOPS_DISPATCHED CMASK=1 INV=1"]*100/(it->second)[
"UNHALTED_CORE_CYCLES"];
501 (it->second)[
"L2 Miss % of counted Stalled Cycles"] =(it->second)[
"L2 Miss Impact"]*100/(it->second)[
"Counted Stalled Cycles"];
502 (it->second)[
"L2 Hit % of counted Stalled Cycles"] =(it->second)[
"L2 Hit Impact"]*100/(it->second)[
"Counted Stalled Cycles"];
503 (it->second)[
"L1 DTLB Miss % of counted Stalled Cycles"] =(it->second)[
"L1 DTLB Miss Impact"]*100/(it->second)[
"Counted Stalled Cycles"];
504 (it->second)[
"LCP Stalls % of counted Stalled Cycles"] =(it->second)[
"LCP Stalls Impact"]*100/(it->second)[
"Counted Stalled Cycles"];
505 (it->second)[
"Store-Fwd Stalls % of counted Stalled Cycles"] =(it->second)[
"Store-Fwd Stalls Impact"]*100/(it->second)[
"Counted Stalled Cycles"];
506 (it->second)[
"Loads Blocked % of Store-Fwd Stalls Cycles"] =(it->second)[
"Loads Blocked by Unknown Address Store Impact"]*100/(it->second)[
"Store-Fwd Stalls Impact"];
507 (it->second)[
"Loads Overlapped % of Store-Fwd Stalls Cycles"] =(it->second)[
"Loads Overlapped with Stores Impact"]*100/(it->second)[
"Store-Fwd Stalls Impact"];
508 (it->second)[
"Loads Spanning % of Store-Fwd Stalls Cycles"] =(it->second)[
"Loads Spanning across Cache Lines Impact"]*100/(it->second)[
"Store-Fwd Stalls Impact"];
510 (it->second)[
"Load % of all Instructions"] =(it->second)[
"INST_RETIRED:LOADS"]*100/(it->second)[
"Counted Instructions Retired"];
511 (it->second)[
"Store % of all Instructions"] =(it->second)[
"INST_RETIRED:STORES"]*100/(it->second)[
"Counted Instructions Retired"];
512 (it->second)[
"Branch % of all Instructions"] =(it->second)[
"BRANCH_INSTRUCTIONS_RETIRED"]*100/(it->second)[
"Counted Instructions Retired"];
513 (it->second)[
"Packed SIMD % of all Instructions"] =(it->second)[
"SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"]*100/(it->second)[
"Counted Instructions Retired"];
514 (it->second)[
"Other % of all Instructions"] =(it->second)[
"Other Instructions"]*100/(it->second)[
"Counted Instructions Retired"];
520 nhm_caa_events_displ.push_back(
"Total Cycles");
521 nhm_caa_events_displ.push_back(
"Instructions Retired");
522 nhm_caa_events_displ.push_back(
"CPI");
523 nhm_caa_events_displ.push_back(
"");
524 nhm_caa_events_displ.push_back(
"iMargin");
525 nhm_caa_events_displ.push_back(
"iFactor");
526 nhm_caa_events_displ.push_back(
"");
527 nhm_caa_events_displ.push_back(
"Stalled Cycles");
528 nhm_caa_events_displ.push_back(
"% of Total Cycles");
529 nhm_caa_events_displ.push_back(
"Total Counted Stalled Cycles");
530 nhm_caa_events_displ.push_back(
"");
531 nhm_caa_events_displ.push_back(
"Instruction Starvation % of Total Cycles");
532 nhm_caa_events_displ.push_back(
"# of Instructions per Call");
533 nhm_caa_events_displ.push_back(
"% of Total Cycles spent handling FP exceptions");
534 nhm_caa_events_displ.push_back(
"");
535 nhm_caa_events_displ.push_back(
"Counted Stalled Cycles due to Load Ops");
536 nhm_caa_events_displ.push_back(
"");
537 nhm_caa_events_displ.push_back(
"L2 Hit Impact");
538 nhm_caa_events_displ.push_back(
"L2 Hit % of Load Stalls");
539 nhm_caa_events_displ.push_back(
"");
540 nhm_caa_events_displ.push_back(
"L3 Unshared Hit Impact");
541 nhm_caa_events_displ.push_back(
"L3 Unshared Hit % of Load Stalls");
542 nhm_caa_events_displ.push_back(
"");
543 nhm_caa_events_displ.push_back(
"L2 Other Core Hit Impact");
544 nhm_caa_events_displ.push_back(
"L2 Other Core Hit % of Load Stalls");
545 nhm_caa_events_displ.push_back(
"");
546 nhm_caa_events_displ.push_back(
"L2 Other Core Hit Modified Impact");
547 nhm_caa_events_displ.push_back(
"L2 Other Core Hit Modified % of Load Stalls");
548 nhm_caa_events_displ.push_back(
"");
549 nhm_caa_events_displ.push_back(
"L3 Miss -> Local DRAM Hit Impact");
550 nhm_caa_events_displ.push_back(
"L3 Miss -> Remote DRAM Hit Impact");
551 nhm_caa_events_displ.push_back(
"L3 Miss -> Remote Cache Hit Impact");
552 nhm_caa_events_displ.push_back(
"L3 Miss -> Total Impact");
553 nhm_caa_events_displ.push_back(
"L3 Miss % of Load Stalls");
554 nhm_caa_events_displ.push_back(
"");
555 nhm_caa_events_displ.push_back(
"L1 DTLB Miss Impact");
556 nhm_caa_events_displ.push_back(
"L1 DTLB Miss % of Load Stalls");
557 nhm_caa_events_displ.push_back(
"");
558 nhm_caa_events_displ.push_back(
"Cycles spent during DIV & SQRT Ops");
559 nhm_caa_events_displ.push_back(
"DIV & SQRT Ops % of counted Stalled Cycles");
560 nhm_caa_events_displ.push_back(
"");
561 nhm_caa_events_displ.push_back(
"Total L2 IFETCH misses");
562 nhm_caa_events_displ.push_back(
"% of L2 IFETCH misses");
563 nhm_caa_events_displ.push_back(
"");
564 nhm_caa_events_displ.push_back(
"% of IFETCHes served by Local DRAM");
565 nhm_caa_events_displ.push_back(
"% of IFETCHes served by L3 (Modified)");
566 nhm_caa_events_displ.push_back(
"% of IFETCHes served by L3 (Clean Snoop)");
567 nhm_caa_events_displ.push_back(
"% of IFETCHes served by Remote L2");
568 nhm_caa_events_displ.push_back(
"% of IFETCHes served by Remote DRAM");
569 nhm_caa_events_displ.push_back(
"% of IFETCHes served by L3 (No Snoop)");
570 nhm_caa_events_displ.push_back(
"");
571 nhm_caa_events_displ.push_back(
"Total L2 IFETCH miss Impact");
572 nhm_caa_events_displ.push_back(
"");
573 nhm_caa_events_displ.push_back(
"Cycles IFETCH served by Local DRAM");
574 nhm_caa_events_displ.push_back(
"Local DRAM IFECTHes % Impact");
575 nhm_caa_events_displ.push_back(
"");
576 nhm_caa_events_displ.push_back(
"Cycles IFETCH served by L3 (Modified)");
577 nhm_caa_events_displ.push_back(
"L3 (Modified) IFECTHes % Impact");
578 nhm_caa_events_displ.push_back(
"");
579 nhm_caa_events_displ.push_back(
"Cycles IFETCH served by L3 (Clean Snoop)");
580 nhm_caa_events_displ.push_back(
"L3 (Clean Snoop) IFECTHes % Impact");
581 nhm_caa_events_displ.push_back(
"");
582 nhm_caa_events_displ.push_back(
"Cycles IFETCH served by Remote L2");
583 nhm_caa_events_displ.push_back(
"Remote L2 IFECTHes % Impact");
584 nhm_caa_events_displ.push_back(
"");
585 nhm_caa_events_displ.push_back(
"Cycles IFETCH served by Remote DRAM");
586 nhm_caa_events_displ.push_back(
"Remote DRAM IFECTHes % Impact");
587 nhm_caa_events_displ.push_back(
"");
588 nhm_caa_events_displ.push_back(
"Cycles IFETCH served by L3 (No Snoop)");
589 nhm_caa_events_displ.push_back(
"L3 (No Snoop) IFECTHes % Impact");
590 nhm_caa_events_displ.push_back(
"");
591 nhm_caa_events_displ.push_back(
"Total Branch Instructions Executed");
592 nhm_caa_events_displ.push_back(
"% of Mispredicted Branches");
593 nhm_caa_events_displ.push_back(
"");
594 nhm_caa_events_displ.push_back(
"Direct Near Calls % of Total Branches Executed");
595 nhm_caa_events_displ.push_back(
"Indirect Near Calls % of Total Branches Executed");
596 nhm_caa_events_displ.push_back(
"Indirect Near Non-Calls % of Total Branches Executed");
597 nhm_caa_events_displ.push_back(
"All Near Calls % of Total Branches Executed");
598 nhm_caa_events_displ.push_back(
"All Non Calls % of Total Branches Executed");
599 nhm_caa_events_displ.push_back(
"All Returns % of Total Branches Executed");
600 nhm_caa_events_displ.push_back(
"");
601 nhm_caa_events_displ.push_back(
"Total Branch Instructions Retired");
602 nhm_caa_events_displ.push_back(
"Conditionals % of Total Branches Retired");
603 nhm_caa_events_displ.push_back(
"Near Calls % of Total Branches Retired");
604 nhm_caa_events_displ.push_back(
"");
605 nhm_caa_events_displ.push_back(
"L1 ITLB Miss Impact");
606 nhm_caa_events_displ.push_back(
"ITLB Miss Rate in %");
607 nhm_caa_events_displ.push_back(
"");
608 nhm_caa_events_displ.push_back(
"Branch Instructions");
609 nhm_caa_events_displ.push_back(
"Branch % of all Instructions");
610 nhm_caa_events_displ.push_back(
"");
611 nhm_caa_events_displ.push_back(
"Load Instructions");
612 nhm_caa_events_displ.push_back(
"Load % of all Instructions");
613 nhm_caa_events_displ.push_back(
"");
614 nhm_caa_events_displ.push_back(
"Store Instructions");
615 nhm_caa_events_displ.push_back(
"Store % of all Instructions");
616 nhm_caa_events_displ.push_back(
"");
617 nhm_caa_events_displ.push_back(
"Other Instructions");
618 nhm_caa_events_displ.push_back(
"Other % of all Instructions");
619 nhm_caa_events_displ.push_back(
"");
620 nhm_caa_events_displ.push_back(
"Packed UOPS Retired");
621 nhm_caa_events_displ.push_back(
"Packed % of all UOPS Retired");
626 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
628 (it->second)[
"Total Cycles"] = (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"];
630 (it->second)[
"L2 Hit Impact"] = (it->second)[
"MEM_LOAD_RETIRED:L2_HIT"] *
I7_L2_HIT_CYCLES;
632 if((it->second)[
"MEM_LOAD_RETIRED:OTHER_CORE_L2_HIT_HITM"]>(it->second)[
"MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM"])
634 (it->second)[
"L2 Other Core Hit Impact"] = ((it->second)[
"MEM_LOAD_RETIRED:OTHER_CORE_L2_HIT_HITM"] - (it->second)[
"MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM"])*
I7_OTHER_CORE_L2_HIT_CYCLES;
638 (it->second)[
"L2 Other Core Hit Impact"] = 0.0;
640 (it->second)[
"L2 Other Core Hit Modified Impact"] = (it->second)[
"MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM"] *
I7_OTHER_CORE_L2_HITM_CYCLES;
644 (it->second)[
"L3 Miss -> Total Impact"] = (it->second)[
"L3 Miss -> Local DRAM Hit Impact"] + (it->second)[
"L3 Miss -> Remote DRAM Hit Impact"] + (it->second)[
"L3 Miss -> Remote Cache Hit Impact"];
646 (it->second)[
"Counted Stalled Cycles due to Load Ops"] = (it->second)[
"L3 Miss -> Total Impact"] + (it->second)[
"L2 Hit Impact"] + (it->second)[
"L1 DTLB Miss Impact"] + (it->second)[
"L3 Unshared Hit Impact"] + (it->second)[
"L2 Other Core Hit Modified Impact"] + (it->second)[
"L2 Other Core Hit Impact"];
647 (it->second)[
"Cycles spent during DIV & SQRT Ops"] = (it->second)[
"ARITH:CYCLES_DIV_BUSY"];
648 (it->second)[
"Total Counted Stalled Cycles"] = (it->second)[
"Counted Stalled Cycles due to Load Ops"] + (it->second)[
"Cycles spent during DIV & SQRT Ops"];
649 (it->second)[
"Stalled Cycles"] = (it->second)[
"Total Counted Stalled Cycles"];
650 (it->second)[
"% of Total Cycles"] = (it->second)[
"Stalled Cycles"] * 100 / (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"];
651 (it->second)[
"L3 Miss % of Load Stalls"] = (it->second)[
"L3 Miss -> Total Impact"] * 100 / (it->second)[
"Counted Stalled Cycles due to Load Ops"];
652 (it->second)[
"L2 Hit % of Load Stalls"] = (it->second)[
"L2 Hit Impact"] * 100 / (it->second)[
"Counted Stalled Cycles due to Load Ops"];
653 (it->second)[
"L1 DTLB Miss % of Load Stalls"] = (it->second)[
"L1 DTLB Miss Impact"] * 100 / (it->second)[
"Counted Stalled Cycles due to Load Ops"];
654 (it->second)[
"L3 Unshared Hit % of Load Stalls"] = (it->second)[
"L3 Unshared Hit Impact"] * 100 / (it->second)[
"Counted Stalled Cycles due to Load Ops"];
655 (it->second)[
"L2 Other Core Hit % of Load Stalls"] = (it->second)[
"L2 Other Core Hit Impact"] * 100 / (it->second)[
"Counted Stalled Cycles due to Load Ops"];
656 (it->second)[
"L2 Other Core Hit Modified % of Load Stalls"] = (it->second)[
"L2 Other Core Hit Modified Impact"] * 100 / (it->second)[
"Counted Stalled Cycles due to Load Ops"];
657 (it->second)[
"DIV & SQRT Ops % of counted Stalled Cycles"] = (it->second)[
"Cycles spent during DIV & SQRT Ops"] * 100 / (it->second)[
"Total Counted Stalled Cycles"];
660 (it->second)[
"Cycles IFETCH served by L3 (Modified)"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HITM"] *
I7_IFETCH_L2_MISS_L3_HITM;
661 (it->second)[
"Cycles IFETCH served by L3 (Clean Snoop)"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HIT_SNP"] *
I7_IFETCH_L2_MISS_L3_HIT_SNOOP;
665 (it->second)[
"Total L2 IFETCH miss Impact"] = (it->second)[
"Cycles IFETCH served by Local DRAM"] + (it->second)[
"Cycles IFETCH served by L3 (Modified)"] + (it->second)[
"Cycles IFETCH served by L3 (Clean Snoop)"] + (it->second)[
"Cycles IFETCH served by Remote L2"] + (it->second)[
"Cycles IFETCH served by Remote DRAM"] + (it->second)[
"Cycles IFETCH served by L3 (No Snoop)"];
666 (it->second)[
"Local DRAM IFECTHes % Impact"] = (it->second)[
"Cycles IFETCH served by Local DRAM"] * 100 / (it->second)[
"Total L2 IFETCH miss Impact"];
667 (it->second)[
"L3 (Modified) IFECTHes % Impact"] = (it->second)[
"Cycles IFETCH served by L3 (Modified)"] * 100 / (it->second)[
"Total L2 IFETCH miss Impact"];
668 (it->second)[
"L3 (Clean Snoop) IFECTHes % Impact"] = (it->second)[
"Cycles IFETCH served by L3 (Clean Snoop)"] * 100 / (it->second)[
"Total L2 IFETCH miss Impact"];
669 (it->second)[
"Remote L2 IFECTHes % Impact"] = (it->second)[
"Cycles IFETCH served by Remote L2"] * 100 / (it->second)[
"Total L2 IFETCH miss Impact"];
670 (it->second)[
"Remote DRAM IFECTHes % Impact"] = (it->second)[
"Cycles IFETCH served by Remote DRAM"] * 100 / (it->second)[
"Total L2 IFETCH miss Impact"];
671 (it->second)[
"L3 (No Snoop) IFECTHes % Impact"] = (it->second)[
"Cycles IFETCH served by L3 (No Snoop)"] * 100 / (it->second)[
"Total L2 IFETCH miss Impact"];
672 (it->second)[
"Total L2 IFETCH misses"] = (it->second)[
"L2_RQSTS:IFETCH_MISS"];
673 (it->second)[
"% of IFETCHes served by Local DRAM"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:LOCAL_DRAM"] * 100 / (it->second)[
"L2_RQSTS:IFETCH_MISS"];
674 (it->second)[
"% of IFETCHes served by L3 (Modified)"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HITM"] * 100 / (it->second)[
"L2_RQSTS:IFETCH_MISS"];
675 (it->second)[
"% of IFETCHes served by L3 (Clean Snoop)"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HIT_SNP"] * 100 / (it->second)[
"L2_RQSTS:IFETCH_MISS"];
676 (it->second)[
"% of IFETCHes served by Remote L2"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_CACHE_FWD"] * 100 / (it->second)[
"L2_RQSTS:IFETCH_MISS"];
677 (it->second)[
"% of IFETCHes served by Remote DRAM"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_DRAM"] * 100 / (it->second)[
"L2_RQSTS:IFETCH_MISS"];
678 (it->second)[
"% of IFETCHes served by L3 (No Snoop)"] = (it->second)[
"OFFCORE_RESPONSE_0:DMND_IFETCH:UNCORE_HIT"] * 100 / (it->second)[
"L2_RQSTS:IFETCH_MISS"];
679 (it->second)[
"% of L2 IFETCH misses"] = (it->second)[
"L2_RQSTS:IFETCH_MISS"] * 100 / ((it->second)[
"L2_RQSTS:IFETCH_MISS"] + (it->second)[
"L2_RQSTS:IFETCH_HIT"]);
682 (it->second)[
"Total Branch Instructions Executed"] = (it->second)[
"BR_INST_EXEC:ANY"];
683 (it->second)[
"% of Mispredicted Branches"] = (it->second)[
"BR_MISP_EXEC:ANY"] * 100 / (it->second)[
"BR_INST_EXEC:ANY"];
684 (it->second)[
"Direct Near Calls % of Total Branches Executed"] = (it->second)[
"BR_INST_EXEC:DIRECT_NEAR_CALL"] * 100 / (it->second)[
"Total Branch Instructions Executed"];
685 (it->second)[
"Indirect Near Calls % of Total Branches Executed"] = (it->second)[
"BR_INST_EXEC:INDIRECT_NEAR_CALL"] * 100 / (it->second)[
"Total Branch Instructions Executed"];
686 (it->second)[
"Indirect Near Non-Calls % of Total Branches Executed"] = (it->second)[
"BR_INST_EXEC:INDIRECT_NON_CALL"] * 100 / (it->second)[
"Total Branch Instructions Executed"];
687 (it->second)[
"All Near Calls % of Total Branches Executed"] = (it->second)[
"BR_INST_EXEC:NEAR_CALLS"] * 100 / (it->second)[
"Total Branch Instructions Executed"];
688 (it->second)[
"All Non Calls % of Total Branches Executed"] = (it->second)[
"BR_INST_EXEC:NON_CALLS"] * 100 / (it->second)[
"Total Branch Instructions Executed"];
689 (it->second)[
"All Returns % of Total Branches Executed"] = (it->second)[
"BR_INST_EXEC:RETURN_NEAR"] * 100 / (it->second)[
"Total Branch Instructions Executed"];
690 (it->second)[
"Total Branch Instructions Retired"] = (it->second)[
"BR_INST_RETIRED:ALL_BRANCHES"];
691 (it->second)[
"Conditionals % of Total Branches Retired"] = (it->second)[
"BR_INST_RETIRED:CONDITIONAL"] * 100 / (it->second)[
"Total Branch Instructions Retired"];
692 (it->second)[
"Near Calls % of Total Branches Retired"] = (it->second)[
"BR_INST_RETIRED:NEAR_CALL"] * 100 / (it->second)[
"Total Branch Instructions Retired"];
694 (it->second)[
"Instruction Starvation % of Total Cycles"] = ((it->second)[
"UOPS_ISSUED:ANY CMASK=1 INV=1"] - (it->second)[
"RESOURCE_STALLS:ANY"])* 100 / (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"];
695 (it->second)[
"% of Total Cycles spent handling FP exceptions"] = (it->second)[
"UOPS_DECODED:MS CMASK=1"]* 100 / (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"];
696 (it->second)[
"# of Instructions per Call"] = (it->second)[
"INST_RETIRED:ANY_P"] / (it->second)[
"BR_INST_EXEC:NEAR_CALLS"];
698 (it->second)[
"Instructions Retired"] = (it->second)[
"INST_RETIRED:ANY_P"];
699 (it->second)[
"ITLB Miss Rate in %"] = ((it->second)[
"ITLB_MISS_RETIRED"] / (it->second)[
"INST_RETIRED:ANY_P"]) * 100;
701 (it->second)[
"Branch Instructions"] = (it->second)[
"BR_INST_RETIRED:ALL_BRANCHES"];
702 (it->second)[
"Load Instructions"] = (it->second)[
"MEM_INST_RETIRED:LOADS"];
703 (it->second)[
"Store Instructions"] = (it->second)[
"MEM_INST_RETIRED:STORES"];
704 (it->second)[
"Other Instructions"] = (it->second)[
"Instructions Retired"] - (it->second)[
"MEM_INST_RETIRED:LOADS"] - (it->second)[
"MEM_INST_RETIRED:STORES"] - (it->second)[
"BR_INST_RETIRED:ALL_BRANCHES"];
705 (it->second)[
"Packed UOPS Retired"] = (it->second)[
"SSEX_UOPS_RETIRED:PACKED_DOUBLE"] + (it->second)[
"SSEX_UOPS_RETIRED:PACKED_SINGLE"];
706 (it->second)[
"CPI"] = (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"] / (it->second)[
"INST_RETIRED:ANY_P"];
708 double localPerformanceImprovement = (it->second)[
"CPI"]/
EXPECTED_CPI;
709 double cyclesAfterImprovement = (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"]/localPerformanceImprovement;
710 double totalCyclesAfterImprovement = totalCycles-(it->second)[
"CPU_CLK_UNHALTED:THREAD_P"]+cyclesAfterImprovement;
711 (it->second)[
"iMargin"] = 100-(totalCyclesAfterImprovement/totalCycles)*100;
713 (it->second)[
"Load % of all Instructions"] = (it->second)[
"MEM_INST_RETIRED:LOADS"] * 100 / (it->second)[
"INST_RETIRED:ANY_P"];
714 (it->second)[
"Store % of all Instructions"] = (it->second)[
"MEM_INST_RETIRED:STORES"] * 100 / (it->second)[
"INST_RETIRED:ANY_P"];
715 (it->second)[
"Branch % of all Instructions"] = (it->second)[
"BR_INST_RETIRED:ALL_BRANCHES"] * 100 / (it->second)[
"INST_RETIRED:ANY_P"];
716 (it->second)[
"Other % of all Instructions"] = (it->second)[
"Other Instructions"] * 100 / (it->second)[
"INST_RETIRED:ANY_P"];
718 (it->second)[
"Packed % of all UOPS Retired"] = (it->second)[
"Packed UOPS Retired"] * 100 / (it->second)[
"UOPS_RETIRED:ANY"];
750 void init(
const char* name,
const char* architecture,
const char* event_name,
unsigned int c_mask,
unsigned int inv_mask,
unsigned int smpl_period)
791 if(
samples.empty())
return false;
792 unsigned int cur_max = 0;
793 std::map<std::string, unsigned int>::iterator max_pos;
794 for(std::map<std::string, unsigned int>::iterator it =
samples.begin(); it !=
samples.end(); ++it)
796 if(it->second > cur_max)
798 cur_max = it->second;
802 strcpy(index, (max_pos->first).c_str());
803 *value = max_pos->second;
825 for (
int i=0;
i <
n;
i++)
830 strcat(s_mod,
"<");
833 strcat(s_mod,
">");
836 strcat(s_mod,
"&");
839 strcat(s_mod,
""");
845 strcat(s_mod, to_app);
857 char *operator_string_begin =
const_cast<char *
>(strstr(demangled_symbol,
"operator"));
858 if(operator_string_begin != NULL)
860 char *operator_string_end = operator_string_begin+8;
861 while(*operator_string_end ==
' ') operator_string_end++;
862 if(strstr(operator_string_end,
"delete[]")==operator_string_end)
864 operator_string_end+=8;
865 *operator_string_end=
'\0';
867 else if(strstr(operator_string_end,
"delete")==operator_string_end)
869 operator_string_end+=6;
870 *operator_string_end=
'\0';
872 else if(strstr(operator_string_end,
"new[]")==operator_string_end)
874 operator_string_end+=5;
875 *operator_string_end=
'\0';
877 else if(strstr(operator_string_end,
"new")==operator_string_end)
879 operator_string_end+=3;
880 *operator_string_end=
'\0';
882 else if(strstr(operator_string_end,
">>=")==operator_string_end)
884 operator_string_end+=3;
885 *operator_string_end=
'\0';
887 else if(strstr(operator_string_end,
"<<=")==operator_string_end)
889 operator_string_end+=3;
890 *operator_string_end=
'\0';
892 else if(strstr(operator_string_end,
"->*")==operator_string_end)
894 operator_string_end+=3;
895 *operator_string_end=
'\0';
897 else if(strstr(operator_string_end,
"<<")==operator_string_end)
899 operator_string_end+=2;
900 *operator_string_end=
'\0';
902 else if(strstr(operator_string_end,
">>")==operator_string_end)
904 operator_string_end+=2;
905 *operator_string_end=
'\0';
907 else if(strstr(operator_string_end,
">=")==operator_string_end)
909 operator_string_end+=2;
910 *operator_string_end=
'\0';
912 else if(strstr(operator_string_end,
"<=")==operator_string_end)
914 operator_string_end+=2;
915 *operator_string_end=
'\0';
917 else if(strstr(operator_string_end,
"==")==operator_string_end)
919 operator_string_end+=2;
920 *operator_string_end=
'\0';
922 else if(strstr(operator_string_end,
"!=")==operator_string_end)
924 operator_string_end+=2;
925 *operator_string_end=
'\0';
927 else if(strstr(operator_string_end,
"|=")==operator_string_end)
929 operator_string_end+=2;
930 *operator_string_end=
'\0';
932 else if(strstr(operator_string_end,
"&=")==operator_string_end)
934 operator_string_end+=2;
935 *operator_string_end=
'\0';
937 else if(strstr(operator_string_end,
"^=")==operator_string_end)
939 operator_string_end+=2;
940 *operator_string_end=
'\0';
942 else if(strstr(operator_string_end,
"%=")==operator_string_end)
944 operator_string_end+=2;
945 *operator_string_end=
'\0';
947 else if(strstr(operator_string_end,
"/=")==operator_string_end)
949 operator_string_end+=2;
950 *operator_string_end=
'\0';
952 else if(strstr(operator_string_end,
"*=")==operator_string_end)
954 operator_string_end+=2;
955 *operator_string_end=
'\0';
957 else if(strstr(operator_string_end,
"-=")==operator_string_end)
959 operator_string_end+=2;
960 *operator_string_end=
'\0';
962 else if(strstr(operator_string_end,
"+=")==operator_string_end)
964 operator_string_end+=2;
965 *operator_string_end=
'\0';
967 else if(strstr(operator_string_end,
"&&")==operator_string_end)
969 operator_string_end+=2;
970 *operator_string_end=
'\0';
972 else if(strstr(operator_string_end,
"||")==operator_string_end)
974 operator_string_end+=2;
975 *operator_string_end=
'\0';
977 else if(strstr(operator_string_end,
"[]")==operator_string_end)
979 operator_string_end+=2;
980 *operator_string_end=
'\0';
982 else if(strstr(operator_string_end,
"()")==operator_string_end)
984 operator_string_end+=2;
985 *operator_string_end=
'\0';
987 else if(strstr(operator_string_end,
"++")==operator_string_end)
989 operator_string_end+=2;
990 *operator_string_end=
'\0';
992 else if(strstr(operator_string_end,
"--")==operator_string_end)
994 operator_string_end+=2;
995 *operator_string_end=
'\0';
997 else if(strstr(operator_string_end,
"->")==operator_string_end)
999 operator_string_end+=2;
1000 *operator_string_end=
'\0';
1002 else if(strstr(operator_string_end,
"<")==operator_string_end)
1004 operator_string_end+=1;
1005 *operator_string_end=
'\0';
1007 else if(strstr(operator_string_end,
">")==operator_string_end)
1009 operator_string_end+=1;
1010 *operator_string_end=
'\0';
1012 else if(strstr(operator_string_end,
"~")==operator_string_end)
1014 operator_string_end+=1;
1015 *operator_string_end=
'\0';
1017 else if(strstr(operator_string_end,
"!")==operator_string_end)
1019 operator_string_end+=1;
1020 *operator_string_end=
'\0';
1022 else if(strstr(operator_string_end,
"+")==operator_string_end)
1024 operator_string_end+=1;
1025 *operator_string_end=
'\0';
1027 else if(strstr(operator_string_end,
"-")==operator_string_end)
1029 operator_string_end+=1;
1030 *operator_string_end=
'\0';
1032 else if(strstr(operator_string_end,
"*")==operator_string_end)
1034 operator_string_end+=1;
1035 *operator_string_end=
'\0';
1037 else if(strstr(operator_string_end,
"/")==operator_string_end)
1039 operator_string_end+=1;
1040 *operator_string_end=
'\0';
1042 else if(strstr(operator_string_end,
"%")==operator_string_end)
1044 operator_string_end+=1;
1045 *operator_string_end=
'\0';
1047 else if(strstr(operator_string_end,
"^")==operator_string_end)
1049 operator_string_end+=1;
1050 *operator_string_end=
'\0';
1052 else if(strstr(operator_string_end,
"&")==operator_string_end)
1054 operator_string_end+=1;
1055 *operator_string_end=
'\0';
1057 else if(strstr(operator_string_end,
"|")==operator_string_end)
1059 operator_string_end+=1;
1060 *operator_string_end=
'\0';
1062 else if(strstr(operator_string_end,
",")==operator_string_end)
1064 operator_string_end+=1;
1065 *operator_string_end=
'\0';
1067 else if(strstr(operator_string_end,
"=")==operator_string_end)
1069 operator_string_end+=1;
1070 *operator_string_end=
'\0';
1072 return operator_string_begin;
1074 char *end_of_demangled_name =
const_cast<char *
>(strrchr(demangled_symbol,
')'));
1075 if(end_of_demangled_name != NULL)
1079 while(pars>0 && end_of_demangled_name!=demangled_symbol)
1081 c = *(--end_of_demangled_name);
1094 return demangled_symbol;
1096 char *end_of_func_name = end_of_demangled_name;
1097 if(end_of_func_name != NULL)
1099 *end_of_func_name =
'\0';
1100 char c = *(--end_of_func_name);
1104 while(pars>0 && end_of_func_name!=demangled_symbol)
1106 c = *(--end_of_func_name);
1116 *end_of_func_name =
'\0';
1118 c = *(--end_of_func_name);
1119 while(isalnum(c) || c==
'_' || c==
'~')
1121 c = *(--end_of_func_name);
1123 return ++end_of_func_name;
1125 return demangled_symbol;
1140 strcpy(module_filename, dir);
1141 strcat(module_filename,
"/HTML/");
1142 strcat(module_filename, module_name);
1143 strcat(module_filename,
".html");
1146 strcpy(event, (cur_module->
get_event()).c_str());
1147 std::map<std::string, unsigned int>::iterator result = modules_tot_samples.find(cur_module->
get_module_name());
1149 if(result == modules_tot_samples.end())
1151 if((!strcmp(event,
"UNHALTED_CORE_CYCLES") && !nehalem) || (!strcmp(event,
"CPU_CLK_UNHALTED:THREAD_P") && nehalem))
1157 modules_tot_samples.insert(std::pair<std::string, unsigned int>(cur_module->
get_module_name(), 0));
1159 module_file = fopen(module_filename,
"w");
1160 if(module_file == NULL)
1162 fprintf(stderr,
"ERROR: Cannot create file %s!!!\naborting...\n", module_filename);
1165 fprintf(module_file,
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
1166 fprintf(module_file,
"<html>\n");
1167 fprintf(module_file,
"<head>\n");
1168 fprintf(module_file,
"<title>\n");
1169 fprintf(module_file,
"%s\n", module_name);
1170 fprintf(module_file,
"</title>\n");
1171 fprintf(module_file,
"</head>\n");
1172 fprintf(module_file,
"<body>\n");
1173 fprintf(module_file,
"<h2>%s</h2><br/>Events Sampled:<br/>\n", module_name);
1174 fprintf(module_file,
"<ul>\n");
1175 for(std::vector<std::string>::const_iterator it = S_events.begin(); it != S_events.end(); ++it)
1177 fprintf(module_file,
"<li><a href=\"#%s\">%s</a></li>\n", it->c_str(), it->c_str());
1179 fprintf(module_file,
"</ul>\n");
1183 if((!strcmp(event,
"UNHALTED_CORE_CYCLES") && !nehalem) || (!strcmp(event,
"CPU_CLK_UNHALTED:THREAD_P") && nehalem))
1187 module_file = fopen(module_filename,
"a");
1191 strcpy(event_str, event);
1194 sprintf(event_str,
"%s CMASK=%d", event_str, cur_module->
get_c_mask());
1198 sprintf(event_str,
"%s INV=%d", event_str, cur_module->
get_inv_mask());
1200 fprintf(module_file,
"<a name=\"%s\"><a>\n", event_str);
1201 fprintf(module_file,
"<table cellpadding=\"5\">\n");
1202 fprintf(module_file,
"<tr bgcolor=\"#EEEEEE\">\n");
1204 fprintf(module_file,
"</tr>\n");
1205 fprintf(module_file,
"<tr bgcolor=\"#EEEEEE\">\n");
1206 fprintf(module_file,
"<th align=\"left\">Samples</th>\n");
1207 fprintf(module_file,
"<th align=\"left\">Percentage</th>\n");
1208 fprintf(module_file,
"<th align=\"left\">Symbol Name</th>\n");
1209 fprintf(module_file,
"<th align=\"left\">Library Name</th>\n");
1210 fprintf(module_file,
"<th align=\"left\">Complete Signature</th>\n");
1211 fprintf(module_file,
"<th align=\"left\">Library Pathname</th>\n");
1212 fprintf(module_file,
"</tr>\n");
1213 for(
int j=0; j<20; j++)
1236 bool res = cur_module->
get_max(index, &value);
1238 char *sym_end = strchr(index,
'%');
1241 fprintf(stderr,
"ERROR: Invalid sym and lib name! : %s\naborting...\n", index);
1244 strncpy(sym, index, strlen(index)-strlen(sym_end));
1245 strcpy(lib, sym_end+1);
1250 if(strrchr(lib,
'/')!=NULL && *(strrchr(lib,
'/')+1)!=
'\0')
1252 strcpy(simple_lib, strrchr(lib,
'/')+1);
1256 strcpy(simple_lib, lib);
1260 fprintf(module_file,
"<tr bgcolor=\"#FFFFCC\">\n");
1264 fprintf(module_file,
"<tr bgcolor=\"#CCFFCC\">\n");
1266 fprintf(module_file,
"<td style=\"font-family:monospace;font-size:large;color:DarkBlue\">%u</td>\n", value);
1267 fprintf(module_file,
"<td style=\"font-family:monospace;font-size:large;color:DarkBlue\">%f%%</td>\n", (((
double)(value))/((
double)(cur_module->
get_total_num_samples())))*100);
1272 fprintf(module_file,
"<td style=\"font-family:courier;\">%s</td>\n", simple_sym_mod);
1273 fprintf(module_file,
"<td style=\"font-family:courier;\">%s</td>\n", simple_lib_mod);
1274 fprintf(module_file,
"<td style=\"font-family:courier;\">%s</td>\n", sym_mod);
1275 fprintf(module_file,
"<td style=\"font-family:courier;\">%s</td>\n</tr>\n", lib_mod);
1277 fprintf(module_file,
"</table><br/><br/>\n");
1278 int res = fclose(module_file);
1281 fprintf(stderr,
"ERROR: Cannot close file %s!!!\naborting...\n", module_filename);
1309 unsigned int module_num = 0;
1313 strcpy(path_name, dir);
1314 strcat(path_name,
"/");
1315 strcat(path_name, filename);
1316 gzFile res_file = gzopen(path_name,
"rb");
1318 if(res_file != NULL)
1322 if(line[strlen(line)-1]==
'\n') line[strlen(line)-1]=
'\0';
1324 sscanf(line,
"%s %s %u %u %u", arch, event, &cmask, &inv, &sp);
1325 if(!strcmp(arch,
"NHM")) nehalem =
true;
else nehalem =
false;
1329 if(line[strlen(line)-1]==
'\n') line[strlen(line)-1]=
'\0';
1330 if(strchr(line,
' ')==NULL)
1335 cur_module->
clear();
1338 char *end_sym = strchr(line,
'%');
1341 fprintf(stderr,
"ERROR: Invalid module name. \nLINE: %s\naborting...\n", line);
1345 strncpy(cur_module_name, line, strlen(line)-strlen(end_sym));
1346 cur_module->
init(cur_module_name, arch, event, cmask, inv, sp);
1351 unsigned int value=0, libOffset=0;
1361 sscanf(line,
"%s %s %u %u", symbol, libName, &libOffset, &value);
1362 char realPathName_s[FILENAME_MAX];
1363 bzero(realPathName_s, FILENAME_MAX);
1364 char *realPathName = realpath(libName, realPathName_s);
1365 if(realPathName!=NULL && strlen(realPathName)>0)
1367 std::map<std::string, FileInfo>::iterator result;
1368 result = libsInfo.find(realPathName);
1369 if(result == libsInfo.end())
1371 libsInfo[realPathName] =
FileInfo(realPathName,
true);
1373 const char *temp_sym = libsInfo[realPathName].symbolByOffset(libOffset);
1374 if(temp_sym!=NULL && strlen(temp_sym)>0)
1377 char *demangled_symbol = abi::__cxa_demangle(temp_sym, NULL, NULL, &status);
1380 strcpy(final_sym, demangled_symbol);
1381 free(demangled_symbol);
1385 strcpy(final_sym, temp_sym);
1390 strcpy(final_sym,
"???");
1392 strcpy(final_lib, realPathName);
1396 strcpy(final_sym, symbol);
1397 strcpy(final_lib, libName);
1401 strcpy(index, final_sym);
1403 strcat(index, final_lib);
1409 cur_module->
clear();
1414 fprintf(stderr,
"ERROR: Unable to open input file: %s\naborting...\n", filename);
1437 strcpy(path_name, dir);
1438 strcat(path_name,
"/");
1439 strcat(path_name, filename);
1440 gzFile res_file = gzopen(path_name,
"rb");
1441 if(res_file != NULL)
1445 if(line[strlen(line)-1]==
'\n') line[strlen(line)-1]=
'\0';
1447 sscanf(line,
"%s %s %s %s %s\n", arch, event, cmask_str, inv_str, sp_str);
1448 std::string event_str(event);
1449 if(atoi(cmask_str)>0)
1451 event_str +=
" CMASK=";
1452 event_str += cmask_str;
1456 event_str +=
" INV=";
1457 event_str += inv_str;
1459 S_events.push_back(event_str);
1463 fprintf(stderr,
"ERROR: Unable to open input file: %s\naborting...\n", filename);
1474 for(std::map<std::string, unsigned int>::const_iterator
i = modules_tot_samples.begin();
i != modules_tot_samples.end();
i++)
1477 strcpy(module_filename, dir);
1478 strcat(module_filename,
"/HTML/");
1479 strcat(module_filename, (
i->first).c_str());
1480 strcat(module_filename,
".html");
1481 FILE *module_file = fopen(module_filename,
"a");
1482 if(module_file == NULL)
1484 fprintf(stderr,
"ERROR: Unable to append to file: %s\naborting...\n", module_filename);
1487 fprintf(module_file,
"</body>\n</html>\n");
1488 if(fclose(module_file))
1490 fprintf(stderr,
"ERROR: Cannot close file %s!!!\naborting...\n", module_filename);
1518 int number_of_modules = 0;
1520 int no_of_values = 0;
1523 strcpy(path_name, dir);
1524 strcat(path_name,
"/");
1525 strcat(path_name, filename);
1526 FILE *fp = fopen(path_name,
"r");
1527 fscanf(fp,
"%s %s %s %s %s\n", arch, event, cmask_str, inv_str, sp_str);
1528 if(!strcmp(arch,
"NHM")) nehalem =
true;
else nehalem =
false;
1529 std::string event_str(event);
1530 if(atoi(cmask_str)>0)
1532 event_str +=
" CMASK=";
1533 event_str += cmask_str;
1537 event_str +=
" INV=";
1538 event_str += inv_str;
1540 C_events.push_back(event_str);
1541 while(fscanf(fp,
"%s\n", line)!=EOF)
1543 if(isalpha(line[0]))
1545 if(number_of_modules>0)
1547 C_modules[cur_module_name][event_str]=(double)cur_sum/no_of_values;
1551 strcpy(cur_module_name, line);
1552 number_of_modules++;
1554 else if(isdigit(line[0]))
1556 cur_sum += strtol(line, NULL, 10);
1560 C_modules[cur_module_name][event_str]=(double)cur_sum/no_of_values;
1562 return number_of_modules;
1567 fprintf(fp,
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
1568 fprintf(fp,
"<html>\n");
1569 fprintf(fp,
"<head>\n");
1570 fprintf(fp,
"<title>\n");
1571 fprintf(fp,
"Analysis Result\n");
1572 fprintf(fp,
"</title>\n");
1573 fprintf(fp,
"<script src=\"sorttable.js\"></script>\n");
1574 fprintf(fp,
"<style>\ntable.sortable thead {\nbackground-color:#eee;\ncolor:#666666;\nfont-weight:bold;\ncursor:default;\nfont-family:courier;\n}\n</style>\n");
1575 fprintf(fp,
"</head>\n");
1576 fprintf(fp,
"<body link=\"black\">\n");
1577 fprintf(fp,
"<h1>RESULTS:</h1><br/>Click for detailed symbol view...<p/>\n");
1578 fprintf(fp,
"<table class=\"sortable\" cellpadding=\"5\">\n");
1579 fprintf(fp,
"<tr>\n");
1580 fprintf(fp,
"<th>MODULE NAME</th>\n");
1581 for(std::vector<std::string>::const_iterator it = columns.begin(); it != columns.end(); ++it)
1583 if(strlen(it->c_str())==0) fprintf(fp,
"<th bgcolor=\"#FFFFFF\"> </th>\n");
1584 else fprintf(fp,
"<th>%s</th>\n", (*it).c_str());
1586 fprintf(fp,
"</tr>\n");
1593 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1595 if(index%2) fprintf(fp,
"<tr bgcolor=\"#FFFFCC\">\n");
1596 else fprintf(fp,
"<tr bgcolor=\"#CCFFCC\">\n");
1597 fprintf(fp,
"<td style=\"font-family:monospace;font-size:large;color:Black\"><a href=\"%s.html\">%s</a></td>\n", (it->first).c_str(), (it->first).c_str());
1598 for(std::vector<std::string>::const_iterator jt = columns.begin(); jt != columns.end(); ++jt)
1600 if(strlen(jt->c_str())==0)
1602 fprintf(fp,
"<td bgcolor=\"#FFFFFF\"> </td>");
1606 if((it->second).find(*jt) == (it->second).
end())
1608 fprintf(stderr,
"ERROR: Cannot find derivate value \"%s\"!!!\naborting...\n", (*jt).c_str());
1611 fprintf(fp,
"<td style=\"font-family:monospace;font-size:large;color:DarkBlue\" align=\"right\">%.2f</td>\n", (it->second)[*jt]);
1614 fprintf(fp,
"</tr>\n");
1621 fprintf(fp,
"</table>\n</body>\n</html>\n");
1627 fprintf(fp,
"MODULE NAME");
1628 for(std::vector<std::string>::const_iterator it = columns.begin(); it != columns.end(); ++it)
1630 if(strlen(it->c_str())==0) {}
1631 else fprintf(fp,
",%s", (*it).c_str());
1639 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1641 fprintf(fp,
"%s", (it->first).c_str()) ;
1642 for(std::vector<std::string>::const_iterator jt = columns.begin(); jt != columns.end(); ++jt)
1644 if(strlen(jt->c_str())==0) {}
1647 if((it->second).find(*jt) == (it->second).
end())
1649 fprintf(stderr,
"ERROR: Cannot find derivate value \"%s\"!!!\naborting...\n", (*jt).c_str());
1652 fprintf(fp,
",%.2f", (it->second)[*jt]);
1669 double counter_value;
1670 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1672 counter_value = (it->second)[field];
1673 if(max < counter_value) max = counter_value;
1675 if(value>0 && max>0 && normalizeTo>0)
1677 return 1.*value/max*normalizeTo;
1691 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1693 double simdnorm = 1. -
normalize(
"Packed % of all UOPS Retired", (it->second)[
"Packed % of all UOPS Retired"], 1);
1694 double misspnorm =
normalize(
"% of Mispredicted Branches", (it->second)[
"% of Mispredicted Branches"], 1);
1695 double stallnorm =
normalize(
"Stalled Cycles", (it->second)[
"Stalled Cycles"], 1);
1696 (it->second)[
"iFactor"] = stallnorm*(simdnorm + misspnorm + stallnorm);
1701 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1703 double simdnorm = 1. -
normalize(
"Packed SIMD % of all Instructions", (it->second)[
"Packed SIMD % of all Instructions"], 1);
1704 double misspnorm =
normalize(
"% of Mispredicted Branches", (it->second)[
"% of Mispredicted Branches"], 1);
1705 double stallnorm =
normalize(
"Stalled Cycles", (it->second)[
"Stalled Cycles"], 1);
1706 (it->second)[
"iFactor"] = stallnorm*(simdnorm + misspnorm + stallnorm);
1720 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1722 sum += (it->second)[
"CPU_CLK_UNHALTED:THREAD_P"];
1727 for(
std::map<std::string, std::map<std::string, double> >::iterator it = C_modules.begin(); it != C_modules.end(); ++it)
1729 sum += (it->second)[
"UNHALTED_CORE_CYCLES"];
1740 if(argc<2 || argc>4)
1742 printf(
"\n\nUsage: %s DIRECTORY [--caa] [--csv]\n\n", argv[0]);
1750 if(!strcmp(argv[
i],
"--caa")) caa =
true;
1751 if(!strcmp(argv[i],
"--csv")) csv =
true;
1755 strcpy(dir, argv[1]);
1758 strcat(dir,
"/HTML");
1759 int res = mkdir(dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
1762 fprintf(stderr,
"ERROR: Cannot create directory %s\naborting...\n", dir);
1768 struct dirent *dirp;
1769 int num_of_modules = 0;
1770 if((dp = opendir(argv[1]))==NULL)
1772 printf(
"Error(%d) opening %s\n", errno, argv[1]);
1775 while((dirp = readdir(dp))!=NULL)
1777 if(strstr(dirp->d_name,
"_S_")!=NULL && strstr(dirp->d_name,
".txt.gz")!=NULL && !csv)
1781 fprintf(stderr,
"ERROR: Cannot read file %s\naborting...\n", dirp->d_name);
1787 sort(S_events.begin(), S_events.end());
1788 if((dp = opendir(argv[1]))==NULL)
1790 printf(
"Error(%d) opening %s\n", errno, argv[1]);
1793 while((dirp = readdir(dp))!=NULL)
1795 if(strstr(dirp->d_name,
"_S_")!=NULL && strstr(dirp->d_name,
".txt.gz")!=NULL && !csv)
1799 fprintf(stderr,
"ERROR: Cannot read file %s\naborting...\n", dirp->d_name);
1803 else if(strstr(dirp->d_name,
"_C_")!=NULL && strstr(dirp->d_name,
".txt")!=NULL)
1806 if(res>num_of_modules)
1808 num_of_modules = res;
1818 fprintf(stderr,
"ERROR: Cannot finalize HTML pages!!!\naborting...\n");
1825 if(!csv) sprintf(filepath,
"%s/HTML/index.html", argv[1]);
1826 else sprintf(filepath,
"%s/results.csv", argv[1]);
1827 FILE *fp = fopen(filepath,
"w");
1830 fprintf(stderr,
"ERROR: Cannot create file index.html!!!\naborting...\n");
1842 fprintf(stderr,
"(core) ERROR: One or more events for CAA missing!\naborting...\n");
1865 fprintf(stderr,
"(nehalem) ERROR: One or more events for CAA missing!\naborting...\n");
1905 sprintf(src,
"sorttable.js");
1906 sprintf(dst,
"%s/HTML/sorttable.js", argv[1]);
1907 int fd_src = open(src, O_RDONLY);
1910 fprintf(stderr,
"ERROR: Cannot open file \"%s\"!\naborting...\n", src);
1913 int fd_dst = open(dst, O_WRONLY|O_CREAT|O_TRUNC, 0644);
1916 fprintf(stderr,
"ERROR: Cannot open file \"%s\" (%s)!\naborting...\n", dst, strerror(errno));
1920 while(read(fd_src, &c, 1))
1922 write(fd_dst, &c, 1);
#define MAX_EVENT_NAME_LENGTH
std::map< std::string, unsigned int > samples
GAUDI_API long argc()
Number of arguments passed to the commandline (==numCmdLineArgs()); just to match argv call...
unsigned int get_inv_mask()
#define I7_L3_UNSHARED_HIT_CYCLES
const char * func_name(const char *demangled_symbol)
const char * symbolByOffset(Offset offset)
bool skipString(const char *strptr, const char *srcbuffer, const char **dstbuffer)
#define MAX_SAMPLE_INDEX_LENGTH
#define CORE_UNKNOWN_ADDR_STORE_CYCLES
#define CORE_LCP_STALL_CYCLES
void put_C_footer(FILE *fp)
void put_S_module(S_module *cur_module, const char *dir)
double sum(double x, double y, double z)
#define I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES
void init_core_caa_events_displ()
void put_C_modules(FILE *fp, std::vector< std::string > &columns)
bool get_max(char *index, unsigned int *value)
void init_core_caa_events()
#define I7_IFETCH_L2_MISS_L3_HITM
int read_S_file(const char *dir, const char *filename)
std::vector< CacheItem > SymbolCache
#define I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD
bool check_for_nhm_caa_events()
unsigned int get_smpl_period()
std::istringstream & output(void)
#define MAX_ARCH_NAME_LENGTH
void add_sample(const char *index, unsigned int value)
#define I7_OTHER_CORE_L2_HITM_CYCLES
double normalize(std::string field, double value, double normalizeTo)
#define CORE_L1_DTLB_MISS_CYCLES
FileInfo(const std::string &name, bool useGdb)
#define CORE_OVERLAPPING_CYCLES
void calc_post_deriv_values()
void calc_nhm_deriv_values(double totalCycles)
#define MAX_SIMPLE_SYM_LENGTH
void init_nhm_caa_events_displ()
#define MAX_LIB_MOD_LENGTH
int finalize_S_html_pages(const char *dir)
void put_C_header(FILE *fp, std::vector< std::string > &columns)
#define MAX_SIMPLE_LIB_MOD_LENGTH
void init_nhm_caa_events()
#define I7_L1_ITLB_WALK_COMPLETED_CYCLES
void calc_core_deriv_values(double totalCycles)
#define MAX_SP_STR_LENGTH
Offset next(Offset offset)
struct GAUDI_API map
Parametrisation class for map-like implementation.
void init(const char *name, const char *architecture, const char *event_name, unsigned int c_mask, unsigned int inv_mask, unsigned int smpl_period)
#define I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES
unsigned int total_num_samples
void set_total(unsigned int total)
#define I7_OTHER_CORE_L2_HIT_CYCLES
void html_special_chars(const char *s, char *s_mod)
#define MAX_CMASK_STR_LENGTH
#define I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES
#define CORE_SPAN_ACROSS_CACHE_LINE_CYCLES
int read_S_events(const char *dir, const char *filename)
#define I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP
#define I7_L1_DTLB_WALK_COMPLETED_CYCLES
CacheItem(Offset offset, const std::string &name)
bool operator()(const int &a, const CacheItem &b) const
#define I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT
#define MAX_FILENAME_LENGTH
#define CORE_L2_MISS_CYCLES
void put_C_header_csv(FILE *fp, std::vector< std::string > &columns)
#define PIPE_BUFFER_LENGTH
void createOffsetMap(void)
#define MAX_SIMPLE_SYM_MOD_LENGTH
SymbolCache m_symbolCache
#define MAX_INV_STR_LENGTH
bool check_for_core_caa_events()
#define I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT
PipeReader(const char *cmd)
bool operator()(const CacheItem &a, const int &b) const
void put_C_modules_csv(FILE *fp, std::vector< std::string > &columns)
unsigned int get_total_num_samples()
#define MAX_MODULE_NAME_LENGTH
#define MAX_SIMPLE_LIB_LENGTH
bool skipWhitespaces(const char *srcbuffer, const char **destbuffer)
#define I7_IFETCH_L2_MISS_L3_HIT_SNOOP
int read_C_file(const char *dir, const char *filename)
int main(int argc, char *argv[])
std::string get_module_name()
#define CORE_L2_HIT_CYCLES
#define MAX_SYM_MOD_LENGTH
unsigned int get_c_mask()