| The Gaudi Framework v32r1 (f65d50dc)

Classes | Macros | Functions
pfm_gen_analysis.cpp File Reference
`#include <ctype.h>`
`#include <cxxabi.h>`
`#include <fcntl.h>`
`#include <math.h>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <unistd.h>`
`#include <zlib.h>`
`#include <algorithm>`
`#include <iostream>`
`#include <list>`
`#include <map>`
`#include <sstream>`
`#include <string>`
`#include <vector>`
`#include <dirent.h>`
`#include <errno.h>`
Include dependency graph for pfm_gen_analysis.cpp:

Go to the source code of this file.

## Classes
class | PipeReader
class | FileInfo
struct | FileInfo::CacheItem
struct | FileInfo::CacheItemComparator
class | S_module

## Macros
#define | CORE_L2_MISS_CYCLES 200
#define | CORE_L2_HIT_CYCLES 14.5
#define | CORE_L1_DTLB_MISS_CYCLES 10
#define | CORE_LCP_STALL_CYCLES 6
#define | CORE_UNKNOWN_ADDR_STORE_CYCLES 5
#define | CORE_OVERLAPPING_CYCLES 6
#define | CORE_SPAN_ACROSS_CACHE_LINE_CYCLES 20
#define | I7_L1_DTLB_WALK_COMPLETED_CYCLES 35
#define | I7_L1_ITLB_WALK_COMPLETED_CYCLES 35
#define | I7_L2_HIT_CYCLES 6
#define | I7_L3_UNSHARED_HIT_CYCLES 35
#define | I7_OTHER_CORE_L2_HIT_CYCLES 60
#define | I7_OTHER_CORE_L2_HITM_CYCLES 75
#define | I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES 225
#define | I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES 360
#define | I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES 180
#define | I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT 200
#define | I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT 350
#define | I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP 35
#define | I7_IFETCH_L2_MISS_L3_HIT_SNOOP 60
#define | I7_IFETCH_L2_MISS_L3_HITM 75
#define | I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD 180
#define | MAX_MODULES 1000
#define | EXPECTED_CPI 0.25
#define | MAX_FILENAME_LENGTH 1024
#define | MAX_SAMPLE_INDEX_LENGTH 10000
#define | MAX_SYM_LENGTH 15000
#define | MAX_SYM_MOD_LENGTH 20000
#define | MAX_LIB_LENGTH 5000
#define | MAX_LIB_MOD_LENGTH 7000
#define | MAX_SIMPLE_SYM_LENGTH 300
#define | MAX_SIMPLE_SYM_MOD_LENGTH 500
#define | MAX_SIMPLE_LIB_LENGTH 300
#define | MAX_SIMPLE_LIB_MOD_LENGTH 500
#define | MAX_LINE_LENGTH 20000
#define | MAX_EVENT_NAME_LENGTH 150
#define | MAX_MODULE_NAME_LENGTH 250
#define | MAX_VALUE_STRING_LENGTH 250
#define | MAX_ARCH_NAME_LENGTH 20
#define | MAX_CMASK_STR_LENGTH 5
#define | MAX_INV_STR_LENGTH 5
#define | MAX_SP_STR_LENGTH 50
#define | PIPE_BUFFER_LENGTH 1000

## Functions
bool | skipWhitespaces (const char *srcbuffer, const char **destbuffer)
bool | skipString (const char *strptr, const char *srcbuffer, const char **dstbuffer)
void | init_core_caa_events ()
void | init_nhm_caa_events ()
bool | check_for_core_caa_events ()
bool | check_for_nhm_caa_events ()
void | init_core_caa_events_displ ()
void | calc_core_deriv_values (double totalCycles)
void | init_nhm_caa_events_displ ()
void | calc_nhm_deriv_values (double totalCycles)
void | html_special_chars (const char *s, char *s_mod)
const char * | func_name (const char *demangled_symbol)
void | put_S_module (S_module *cur_module, const char *dir)
int | read_S_file (const char *dir, const char *filename)
int | read_S_events (const char *dir, const char *filename)
int | finalize_S_html_pages (const char *dir)
int | read_C_file (const char *dir, const char *filename)
void | put_C_header (FILE *fp, std::vector< std::string > &columns)
void | put_C_modules (FILE *fp, std::vector< std::string > &columns)
void | put_C_footer (FILE *fp)
void | put_C_header_csv (FILE *fp, std::vector< std::string > &columns)
void | put_C_modules_csv (FILE *fp, std::vector< std::string > &columns)
double | normalize (std::string field, double value, double normalizeTo)
void | calc_post_deriv_values ()
double | getTotalCycles ()
int | main (int argc, char *argv[])

## Macro Definition Documentation

## ◆ CORE_L1_DTLB_MISS_CYCLES

#define CORE_L1_DTLB_MISS_CYCLES 10

Definition at line 41 of file pfm_gen_analysis.cpp.

## ◆ CORE_L2_HIT_CYCLES

#define CORE_L2_HIT_CYCLES 14.5

Definition at line 40 of file pfm_gen_analysis.cpp.

## ◆ CORE_L2_MISS_CYCLES

#define CORE_L2_MISS_CYCLES 200

Definition at line 39 of file pfm_gen_analysis.cpp.

## ◆ CORE_LCP_STALL_CYCLES

#define CORE_LCP_STALL_CYCLES 6

Definition at line 42 of file pfm_gen_analysis.cpp.

## ◆ CORE_OVERLAPPING_CYCLES

#define CORE_OVERLAPPING_CYCLES 6

Definition at line 44 of file pfm_gen_analysis.cpp.

## ◆ CORE_SPAN_ACROSS_CACHE_LINE_CYCLES

#define CORE_SPAN_ACROSS_CACHE_LINE_CYCLES 20

Definition at line 45 of file pfm_gen_analysis.cpp.

## ◆ CORE_UNKNOWN_ADDR_STORE_CYCLES

#define CORE_UNKNOWN_ADDR_STORE_CYCLES 5

Definition at line 43 of file pfm_gen_analysis.cpp.

## ◆ EXPECTED_CPI

#define EXPECTED_CPI 0.25

Definition at line 66 of file pfm_gen_analysis.cpp.

## ◆ I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP

#define I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP 35

Definition at line 59 of file pfm_gen_analysis.cpp.

## ◆ I7_IFETCH_L2_MISS_L3_HIT_SNOOP

#define I7_IFETCH_L2_MISS_L3_HIT_SNOOP 60

Definition at line 60 of file pfm_gen_analysis.cpp.

## ◆ I7_IFETCH_L2_MISS_L3_HITM

#define I7_IFETCH_L2_MISS_L3_HITM 75

Definition at line 61 of file pfm_gen_analysis.cpp.

## ◆ I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT

#define I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT 200

Definition at line 57 of file pfm_gen_analysis.cpp.

## ◆ I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD

#define I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD 180

Definition at line 62 of file pfm_gen_analysis.cpp.

## ◆ I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT

#define I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT 350

Definition at line 58 of file pfm_gen_analysis.cpp.

## ◆ I7_L1_DTLB_WALK_COMPLETED_CYCLES

#define I7_L1_DTLB_WALK_COMPLETED_CYCLES 35

Definition at line 48 of file pfm_gen_analysis.cpp.

## ◆ I7_L1_ITLB_WALK_COMPLETED_CYCLES

#define I7_L1_ITLB_WALK_COMPLETED_CYCLES 35

Definition at line 49 of file pfm_gen_analysis.cpp.

## ◆ I7_L2_HIT_CYCLES

#define I7_L2_HIT_CYCLES 6

Definition at line 50 of file pfm_gen_analysis.cpp.

## ◆ I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES

#define I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES 225

Definition at line 54 of file pfm_gen_analysis.cpp.

## ◆ I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES

#define I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES 180

Definition at line 56 of file pfm_gen_analysis.cpp.

## ◆ I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES

#define I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES 360

Definition at line 55 of file pfm_gen_analysis.cpp.

## ◆ I7_L3_UNSHARED_HIT_CYCLES

#define I7_L3_UNSHARED_HIT_CYCLES 35

Definition at line 51 of file pfm_gen_analysis.cpp.

## ◆ I7_OTHER_CORE_L2_HIT_CYCLES

#define I7_OTHER_CORE_L2_HIT_CYCLES 60

Definition at line 52 of file pfm_gen_analysis.cpp.

## ◆ I7_OTHER_CORE_L2_HITM_CYCLES

#define I7_OTHER_CORE_L2_HITM_CYCLES 75

Definition at line 53 of file pfm_gen_analysis.cpp.

## ◆ MAX_ARCH_NAME_LENGTH

#define MAX_ARCH_NAME_LENGTH 20

Definition at line 82 of file pfm_gen_analysis.cpp.

## ◆ MAX_CMASK_STR_LENGTH

#define MAX_CMASK_STR_LENGTH 5

Definition at line 83 of file pfm_gen_analysis.cpp.

## ◆ MAX_EVENT_NAME_LENGTH

#define MAX_EVENT_NAME_LENGTH 150

Definition at line 79 of file pfm_gen_analysis.cpp.

## ◆ MAX_FILENAME_LENGTH

#define MAX_FILENAME_LENGTH 1024

Definition at line 68 of file pfm_gen_analysis.cpp.

## ◆ MAX_INV_STR_LENGTH

#define MAX_INV_STR_LENGTH 5

Definition at line 84 of file pfm_gen_analysis.cpp.

## ◆ MAX_LIB_LENGTH

#define MAX_LIB_LENGTH 5000

Definition at line 72 of file pfm_gen_analysis.cpp.

## ◆ MAX_LIB_MOD_LENGTH

#define MAX_LIB_MOD_LENGTH 7000

Definition at line 73 of file pfm_gen_analysis.cpp.

## ◆ MAX_LINE_LENGTH

#define MAX_LINE_LENGTH 20000

Definition at line 78 of file pfm_gen_analysis.cpp.

## ◆ MAX_MODULE_NAME_LENGTH

#define MAX_MODULE_NAME_LENGTH 250

Definition at line 80 of file pfm_gen_analysis.cpp.

## ◆ MAX_MODULES

#define MAX_MODULES 1000

Definition at line 64 of file pfm_gen_analysis.cpp.

## ◆ MAX_SAMPLE_INDEX_LENGTH

#define MAX_SAMPLE_INDEX_LENGTH 10000

Definition at line 69 of file pfm_gen_analysis.cpp.

## ◆ MAX_SIMPLE_LIB_LENGTH

#define MAX_SIMPLE_LIB_LENGTH 300

Definition at line 76 of file pfm_gen_analysis.cpp.

## ◆ MAX_SIMPLE_LIB_MOD_LENGTH

#define MAX_SIMPLE_LIB_MOD_LENGTH 500

Definition at line 77 of file pfm_gen_analysis.cpp.

## ◆ MAX_SIMPLE_SYM_LENGTH

#define MAX_SIMPLE_SYM_LENGTH 300

Definition at line 74 of file pfm_gen_analysis.cpp.

## ◆ MAX_SIMPLE_SYM_MOD_LENGTH

#define MAX_SIMPLE_SYM_MOD_LENGTH 500

Definition at line 75 of file pfm_gen_analysis.cpp.

## ◆ MAX_SP_STR_LENGTH

#define MAX_SP_STR_LENGTH 50

Definition at line 85 of file pfm_gen_analysis.cpp.

## ◆ MAX_SYM_LENGTH

#define MAX_SYM_LENGTH 15000

Definition at line 70 of file pfm_gen_analysis.cpp.

## ◆ MAX_SYM_MOD_LENGTH

#define MAX_SYM_MOD_LENGTH 20000

Definition at line 71 of file pfm_gen_analysis.cpp.

## ◆ MAX_VALUE_STRING_LENGTH

#define MAX_VALUE_STRING_LENGTH 250

Definition at line 81 of file pfm_gen_analysis.cpp.

## ◆ PIPE_BUFFER_LENGTH

#define PIPE_BUFFER_LENGTH 1000

Definition at line 87 of file pfm_gen_analysis.cpp.

## Function Documentation

## ◆ calc_core_deriv_values()

void calc_core_deriv_values | ( | double | totalCycles | ) |

Definition at line 411 of file pfm_gen_analysis.cpp.

411 {
412 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
413 ++it ) {
414 ( it->second )["Total Cycles"] = ( it->second )["UNHALTED_CORE_CYCLES"];
415 ( it->second )["Stalled Cycles"] = ( it->second )["RS_UOPS_DISPATCHED CMASK=1 INV=1"];
416 ( it->second )["L2 Miss Impact"] = ( it->second )["MEM_LOAD_RETIRED:L2_LINE_MISS"] * CORE_L2_MISS_CYCLES;
417 ( it->second )["L2 Hit Impact"] =
418 ( ( it->second )["MEM_LOAD_RETIRED:L1D_LINE_MISS"] - ( it->second )["MEM_LOAD_RETIRED:L2_LINE_MISS"] ) *
419 CORE_L2_HIT_CYCLES;
420 ( it->second )["L1 DTLB Miss Impact"] = ( it->second )["MEM_LOAD_RETIRED:DTLB_MISS"] * CORE_L1_DTLB_MISS_CYCLES;
421 ( it->second )["LCP Stalls Impact"] = ( it->second )["ILD_STALL"] * CORE_LCP_STALL_CYCLES;
422 ( it->second )["Loads Blocked by Unknown Address Store Impact"] =
423 ( it->second )["LOAD_BLOCK:STA"] * CORE_UNKNOWN_ADDR_STORE_CYCLES;
424 ( it->second )["Loads Overlapped with Stores Impact"] =
425 ( it->second )["LOAD_BLOCK:OVERLAP_STORE"] * CORE_OVERLAPPING_CYCLES;
426 ( it->second )["Loads Spanning across Cache Lines Impact"] =
427 ( it->second )["LOAD_BLOCK:UNTIL_RETIRE"] * CORE_SPAN_ACROSS_CACHE_LINE_CYCLES;
428 ( it->second )["Store-Fwd Stalls Impact"] = ( it->second )["Loads Blocked by Unknown Address Store Impact"] +
429 ( it->second )["Loads Overlapped with Stores Impact"] +
430 ( it->second )["Loads Spanning across Cache Lines Impact"];
431 ( it->second )["Counted Stalled Cycles"] =
432 ( it->second )["L2 Miss Impact"] + ( it->second )["L2 Hit Impact"] + ( it->second )["LCP Stalls Impact"] +
433 ( it->second )["L1 DTLB Miss Impact"] + ( it->second )["Store-Fwd Stalls Impact"];
434 ( it->second )["Instructions Retired"] = ( it->second )["INSTRUCTIONS_RETIRED"];
435 ( it->second )["ITLB Miss Rate in %"] =
436 ( ( it->second )["ITLB_MISS_RETIRED"] / ( it->second )["INSTRUCTIONS_RETIRED"] ) * 100;
437 ( it->second )["Branch Instructions"] = ( it->second )["BRANCH_INSTRUCTIONS_RETIRED"];
438 ( it->second )["Load Instructions"] = ( it->second )["INST_RETIRED:LOADS"];
439 ( it->second )["Store Instructions"] = ( it->second )["INST_RETIRED:STORES"];
440 ( it->second )["Other Instructions"] = ( it->second )["INST_RETIRED:OTHER"] -
441 ( it->second )["SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"] -
442 ( it->second )["BRANCH_INSTRUCTIONS_RETIRED"];
443 ( it->second )["% of Mispredicted Branches"] =
444 ( ( it->second )["MISPREDICTED_BRANCH_RETIRED"] / ( it->second )["BRANCH_INSTRUCTIONS_RETIRED"] ) * 100;
445 ( it->second )["Packed SIMD Computational Instructions"] =
446 ( it->second )["SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"];
447 ( it->second )["Counted Instructions Retired"] =
448 ( it->second )["Branch Instructions"] + ( it->second )["Load Instructions"] +
449 ( it->second )["Store Instructions"] + ( it->second )["Other Instructions"] +
450 ( it->second )["Packed SIMD Computational Instructions"];
451 ( it->second )["CPI"] = ( it->second )["UNHALTED_CORE_CYCLES"] / ( it->second )["INSTRUCTIONS_RETIRED"];
452
453 double localPerformanceImprovement = ( it->second )["CPI"] / EXPECTED_CPI;
454 double cyclesAfterImprovement = ( it->second )["UNHALTED_CORE_CYCLES"] / localPerformanceImprovement;
455 double totalCyclesAfterImprovement = totalCycles - ( it->second )["UNHALTED_CORE_CYCLES"] + cyclesAfterImprovement;
456 ( it->second )["iMargin"] = 100 - ( totalCyclesAfterImprovement / totalCycles ) * 100;
457
458 ( it->second )["% of Total Cycles"] =
459 ( it->second )["RS_UOPS_DISPATCHED CMASK=1 INV=1"] * 100 / ( it->second )["UNHALTED_CORE_CYCLES"];
460 ( it->second )["L2 Miss % of counted Stalled Cycles"] =
461 ( it->second )["L2 Miss Impact"] * 100 / ( it->second )["Counted Stalled Cycles"];
462 ( it->second )["L2 Hit % of counted Stalled Cycles"] =
463 ( it->second )["L2 Hit Impact"] * 100 / ( it->second )["Counted Stalled Cycles"];
464 ( it->second )["L1 DTLB Miss % of counted Stalled Cycles"] =
465 ( it->second )["L1 DTLB Miss Impact"] * 100 / ( it->second )["Counted Stalled Cycles"];
466 ( it->second )["LCP Stalls % of counted Stalled Cycles"] =
467 ( it->second )["LCP Stalls Impact"] * 100 / ( it->second )["Counted Stalled Cycles"];
468 ( it->second )["Store-Fwd Stalls % of counted Stalled Cycles"] =
469 ( it->second )["Store-Fwd Stalls Impact"] * 100 / ( it->second )["Counted Stalled Cycles"];
470 ( it->second )["Loads Blocked % of Store-Fwd Stalls Cycles"] =
471 ( it->second )["Loads Blocked by Unknown Address Store Impact"] * 100 /
472 ( it->second )["Store-Fwd Stalls Impact"];
473 ( it->second )["Loads Overlapped % of Store-Fwd Stalls Cycles"] =
474 ( it->second )["Loads Overlapped with Stores Impact"] * 100 / ( it->second )["Store-Fwd Stalls Impact"];
475 ( it->second )["Loads Spanning % of Store-Fwd Stalls Cycles"] =
476 ( it->second )["Loads Spanning across Cache Lines Impact"] * 100 / ( it->second )["Store-Fwd Stalls Impact"];
477
478 ( it->second )["Load % of all Instructions"] =
479 ( it->second )["INST_RETIRED:LOADS"] * 100 / ( it->second )["Counted Instructions Retired"];
480 ( it->second )["Store % of all Instructions"] =
481 ( it->second )["INST_RETIRED:STORES"] * 100 / ( it->second )["Counted Instructions Retired"];
482 ( it->second )["Branch % of all Instructions"] =
483 ( it->second )["BRANCH_INSTRUCTIONS_RETIRED"] * 100 / ( it->second )["Counted Instructions Retired"];
484 ( it->second )["Packed SIMD % of all Instructions"] =
485 ( it->second )["SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE"] * 100 /
486 ( it->second )["Counted Instructions Retired"];
487 ( it->second )["Other % of all Instructions"] =
488 ( it->second )["Other Instructions"] * 100 / ( it->second )["Counted Instructions Retired"];
489 }
490 }
CORE_UNKNOWN_ADDR_STORE_CYCLES
#define CORE_UNKNOWN_ADDR_STORE_CYCLES
Definition: pfm_gen_analysis.cpp:43
CORE_LCP_STALL_CYCLES
#define CORE_LCP_STALL_CYCLES
Definition: pfm_gen_analysis.cpp:42
EXPECTED_CPI
#define EXPECTED_CPI
Definition: pfm_gen_analysis.cpp:66
CORE_L1_DTLB_MISS_CYCLES
#define CORE_L1_DTLB_MISS_CYCLES
Definition: pfm_gen_analysis.cpp:41
CORE_OVERLAPPING_CYCLES
#define CORE_OVERLAPPING_CYCLES
Definition: pfm_gen_analysis.cpp:44
std::map
STL class.
std::string
STL class.
CORE_SPAN_ACROSS_CACHE_LINE_CYCLES
#define CORE_SPAN_ACROSS_CACHE_LINE_CYCLES
Definition: pfm_gen_analysis.cpp:45
CORE_L2_MISS_CYCLES
#define CORE_L2_MISS_CYCLES
Definition: pfm_gen_analysis.cpp:39
CORE_L2_HIT_CYCLES
#define CORE_L2_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:40

## ◆ calc_nhm_deriv_values()

void calc_nhm_deriv_values | ( | double | totalCycles | ) |

Definition at line 597 of file pfm_gen_analysis.cpp.

597 {
598 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
599 ++it ) {
600 ( it->second )["Total Cycles"] = ( it->second )["CPU_CLK_UNHALTED:THREAD_P"];
601
602 ( it->second )["L2 Hit Impact"] = ( it->second )["MEM_LOAD_RETIRED:L2_HIT"] * I7_L2_HIT_CYCLES;
603 ( it->second )["L3 Unshared Hit Impact"] =
604 ( it->second )["MEM_LOAD_RETIRED:L3_UNSHARED_HIT"] * I7_L3_UNSHARED_HIT_CYCLES;
605 if ( ( it->second )["MEM_LOAD_RETIRED:OTHER_CORE_L2_HIT_HITM"] >
606 ( it->second )["MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM"] ) {
607 ( it->second )["L2 Other Core Hit Impact"] = ( ( it->second )["MEM_LOAD_RETIRED:OTHER_CORE_L2_HIT_HITM"] -
608 ( it->second )["MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM"] ) *
609 I7_OTHER_CORE_L2_HIT_CYCLES;
610 } else {
611 ( it->second )["L2 Other Core Hit Impact"] = 0.0;
612 }
613 ( it->second )["L2 Other Core Hit Modified Impact"] =
614 ( it->second )["MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM"] * I7_OTHER_CORE_L2_HITM_CYCLES;
615 ( it->second )["L3 Miss -> Local DRAM Hit Impact"] =
616 ( it->second )["MEM_UNCORE_RETIRED:LOCAL_DRAM"] * I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES;
617 ( it->second )["L3 Miss -> Remote DRAM Hit Impact"] =
618 ( it->second )["MEM_UNCORE_RETIRED:REMOTE_DRAM"] * I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES;
619 ( it->second )["L3 Miss -> Remote Cache Hit Impact"] =
620 ( it->second )["MEM_UNCORE_RETIRED:REMOTE_CACHE_LOCAL_HOME_HIT"] * I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES;
621 ( it->second )["L3 Miss -> Total Impact"] = ( it->second )["L3 Miss -> Local DRAM Hit Impact"] +
622 ( it->second )["L3 Miss -> Remote DRAM Hit Impact"] +
623 ( it->second )["L3 Miss -> Remote Cache Hit Impact"];
624 ( it->second )["L1 DTLB Miss Impact"] =
625 ( it->second )["DTLB_LOAD_MISSES:WALK_COMPLETED"] * I7_L1_DTLB_WALK_COMPLETED_CYCLES;
626 ( it->second )["Counted Stalled Cycles due to Load Ops"] =
627 ( it->second )["L3 Miss -> Total Impact"] + ( it->second )["L2 Hit Impact"] +
628 ( it->second )["L1 DTLB Miss Impact"] + ( it->second )["L3 Unshared Hit Impact"] +
629 ( it->second )["L2 Other Core Hit Modified Impact"] + ( it->second )["L2 Other Core Hit Impact"];
630 ( it->second )["Cycles spent during DIV & SQRT Ops"] = ( it->second )["ARITH:CYCLES_DIV_BUSY"];
631 ( it->second )["Total Counted Stalled Cycles"] =
632 ( it->second )["Counted Stalled Cycles due to Load Ops"] + ( it->second )["Cycles spent during DIV & SQRT Ops"];
633 ( it->second )["Stalled Cycles"] =
634 ( it->second )["Total Counted Stalled Cycles"]; // TO BE FIXED when UOPS_EXECUTED:0x3f is fixed!!
635 ( it->second )["% of Total Cycles"] =
636 ( it->second )["Stalled Cycles"] * 100 / ( it->second )["CPU_CLK_UNHALTED:THREAD_P"]; // TO BE FIXED!! see above
637 ( it->second )["L3 Miss % of Load Stalls"] =
638 ( it->second )["L3 Miss -> Total Impact"] * 100 / ( it->second )["Counted Stalled Cycles due to Load Ops"];
639 ( it->second )["L2 Hit % of Load Stalls"] =
640 ( it->second )["L2 Hit Impact"] * 100 / ( it->second )["Counted Stalled Cycles due to Load Ops"];
641 ( it->second )["L1 DTLB Miss % of Load Stalls"] =
642 ( it->second )["L1 DTLB Miss Impact"] * 100 / ( it->second )["Counted Stalled Cycles due to Load Ops"];
643 ( it->second )["L3 Unshared Hit % of Load Stalls"] =
644 ( it->second )["L3 Unshared Hit Impact"] * 100 / ( it->second )["Counted Stalled Cycles due to Load Ops"];
645 ( it->second )["L2 Other Core Hit % of Load Stalls"] =
646 ( it->second )["L2 Other Core Hit Impact"] * 100 / ( it->second )["Counted Stalled Cycles due to Load Ops"];
647 ( it->second )["L2 Other Core Hit Modified % of Load Stalls"] =
648 ( it->second )["L2 Other Core Hit Modified Impact"] * 100 /
649 ( it->second )["Counted Stalled Cycles due to Load Ops"];
650 ( it->second )["DIV & SQRT Ops % of counted Stalled Cycles"] =
651 ( it->second )["Cycles spent during DIV & SQRT Ops"] * 100 / ( it->second )["Total Counted Stalled Cycles"];
652
653 ( it->second )["Cycles IFETCH served by Local DRAM"] =
654 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:LOCAL_DRAM"] * I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT;
655 ( it->second )["Cycles IFETCH served by L3 (Modified)"] =
656 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HITM"] * I7_IFETCH_L2_MISS_L3_HITM;
657 ( it->second )["Cycles IFETCH served by L3 (Clean Snoop)"] =
658 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HIT_SNP"] * I7_IFETCH_L2_MISS_L3_HIT_SNOOP;
659 ( it->second )["Cycles IFETCH served by Remote L2"] =
660 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_CACHE_FWD"] * I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD;
661 ( it->second )["Cycles IFETCH served by Remote DRAM"] =
662 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_DRAM"] * I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT;
663 ( it->second )["Cycles IFETCH served by L3 (No Snoop)"] =
664 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:UNCORE_HIT"] * I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP;
665 ( it->second )["Total L2 IFETCH miss Impact"] =
666 ( it->second )["Cycles IFETCH served by Local DRAM"] + ( it->second )["Cycles IFETCH served by L3 (Modified)"] +
667 ( it->second )["Cycles IFETCH served by L3 (Clean Snoop)"] +
668 ( it->second )["Cycles IFETCH served by Remote L2"] + ( it->second )["Cycles IFETCH served by Remote DRAM"] +
669 ( it->second )["Cycles IFETCH served by L3 (No Snoop)"];
670 ( it->second )["Local DRAM IFECTHes % Impact"] =
671 ( it->second )["Cycles IFETCH served by Local DRAM"] * 100 / ( it->second )["Total L2 IFETCH miss Impact"];
672 ( it->second )["L3 (Modified) IFECTHes % Impact"] =
673 ( it->second )["Cycles IFETCH served by L3 (Modified)"] * 100 / ( it->second )["Total L2 IFETCH miss Impact"];
674 ( it->second )["L3 (Clean Snoop) IFECTHes % Impact"] = ( it->second )["Cycles IFETCH served by L3 (Clean Snoop)"] *
675 100 / ( it->second )["Total L2 IFETCH miss Impact"];
676 ( it->second )["Remote L2 IFECTHes % Impact"] =
677 ( it->second )["Cycles IFETCH served by Remote L2"] * 100 / ( it->second )["Total L2 IFETCH miss Impact"];
678 ( it->second )["Remote DRAM IFECTHes % Impact"] =
679 ( it->second )["Cycles IFETCH served by Remote DRAM"] * 100 / ( it->second )["Total L2 IFETCH miss Impact"];
680 ( it->second )["L3 (No Snoop) IFECTHes % Impact"] =
681 ( it->second )["Cycles IFETCH served by L3 (No Snoop)"] * 100 / ( it->second )["Total L2 IFETCH miss Impact"];
682 ( it->second )["Total L2 IFETCH misses"] = ( it->second )["L2_RQSTS:IFETCH_MISS"];
683 ( it->second )["% of IFETCHes served by Local DRAM"] =
684 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:LOCAL_DRAM"] * 100 / ( it->second )["L2_RQSTS:IFETCH_MISS"];
685 ( it->second )["% of IFETCHes served by L3 (Modified)"] =
686 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HITM"] * 100 / ( it->second )["L2_RQSTS:IFETCH_MISS"];
687 ( it->second )["% of IFETCHes served by L3 (Clean Snoop)"] =
688 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HIT_SNP"] * 100 /
689 ( it->second )["L2_RQSTS:IFETCH_MISS"];
690 ( it->second )["% of IFETCHes served by Remote L2"] =
691 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_CACHE_FWD"] * 100 /
692 ( it->second )["L2_RQSTS:IFETCH_MISS"];
693 ( it->second )["% of IFETCHes served by Remote DRAM"] =
694 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_DRAM"] * 100 / ( it->second )["L2_RQSTS:IFETCH_MISS"];
695 ( it->second )["% of IFETCHes served by L3 (No Snoop)"] =
696 ( it->second )["OFFCORE_RESPONSE_0:DMND_IFETCH:UNCORE_HIT"] * 100 / ( it->second )["L2_RQSTS:IFETCH_MISS"];
697 ( it->second )["% of L2 IFETCH misses"] =
698 ( it->second )["L2_RQSTS:IFETCH_MISS"] * 100 /
699 ( ( it->second )["L2_RQSTS:IFETCH_MISS"] + ( it->second )["L2_RQSTS:IFETCH_HIT"] );
700 ( it->second )["L1 ITLB Miss Impact"] =
701 ( it->second )["ITLB_MISSES:WALK_COMPLETED"] * I7_L1_ITLB_WALK_COMPLETED_CYCLES;
702
703 ( it->second )["Total Branch Instructions Executed"] = ( it->second )["BR_INST_EXEC:ANY"];
704 ( it->second )["% of Mispredicted Branches"] =
705 ( it->second )["BR_MISP_EXEC:ANY"] * 100 / ( it->second )["BR_INST_EXEC:ANY"];
706 ( it->second )["Direct Near Calls % of Total Branches Executed"] =
707 ( it->second )["BR_INST_EXEC:DIRECT_NEAR_CALL"] * 100 / ( it->second )["Total Branch Instructions Executed"];
708 ( it->second )["Indirect Near Calls % of Total Branches Executed"] =
709 ( it->second )["BR_INST_EXEC:INDIRECT_NEAR_CALL"] * 100 / ( it->second )["Total Branch Instructions Executed"];
710 ( it->second )["Indirect Near Non-Calls % of Total Branches Executed"] =
711 ( it->second )["BR_INST_EXEC:INDIRECT_NON_CALL"] * 100 / ( it->second )["Total Branch Instructions Executed"];
712 ( it->second )["All Near Calls % of Total Branches Executed"] =
713 ( it->second )["BR_INST_EXEC:NEAR_CALLS"] * 100 / ( it->second )["Total Branch Instructions Executed"];
714 ( it->second )["All Non Calls % of Total Branches Executed"] =
715 ( it->second )["BR_INST_EXEC:NON_CALLS"] * 100 / ( it->second )["Total Branch Instructions Executed"];
716 ( it->second )["All Returns % of Total Branches Executed"] =
717 ( it->second )["BR_INST_EXEC:RETURN_NEAR"] * 100 / ( it->second )["Total Branch Instructions Executed"];
718 ( it->second )["Total Branch Instructions Retired"] = ( it->second )["BR_INST_RETIRED:ALL_BRANCHES"];
719 ( it->second )["Conditionals % of Total Branches Retired"] =
720 ( it->second )["BR_INST_RETIRED:CONDITIONAL"] * 100 / ( it->second )["Total Branch Instructions Retired"];
721 ( it->second )["Near Calls % of Total Branches Retired"] =
722 ( it->second )["BR_INST_RETIRED:NEAR_CALL"] * 100 / ( it->second )["Total Branch Instructions Retired"];
723
724 ( it->second )["Instruction Starvation % of Total Cycles"] =
725 ( ( it->second )["UOPS_ISSUED:ANY CMASK=1 INV=1"] - ( it->second )["RESOURCE_STALLS:ANY"] ) * 100 /
726 ( it->second )["CPU_CLK_UNHALTED:THREAD_P"];
727 ( it->second )["% of Total Cycles spent handling FP exceptions"] =
728 ( it->second )["UOPS_DECODED:MS CMASK=1"] * 100 / ( it->second )["CPU_CLK_UNHALTED:THREAD_P"];
729 ( it->second )["# of Instructions per Call"] =
730 ( it->second )["INST_RETIRED:ANY_P"] / ( it->second )["BR_INST_EXEC:NEAR_CALLS"];
731
732 ( it->second )["Instructions Retired"] = ( it->second )["INST_RETIRED:ANY_P"];
733 ( it->second )["ITLB Miss Rate in %"] =
734 ( ( it->second )["ITLB_MISS_RETIRED"] / ( it->second )["INST_RETIRED:ANY_P"] ) * 100;
735
736 ( it->second )["Branch Instructions"] = ( it->second )["BR_INST_RETIRED:ALL_BRANCHES"];
737 ( it->second )["Load Instructions"] = ( it->second )["MEM_INST_RETIRED:LOADS"];
738 ( it->second )["Store Instructions"] = ( it->second )["MEM_INST_RETIRED:STORES"];
739 ( it->second )["Other Instructions"] =
740 ( it->second )["Instructions Retired"] - ( it->second )["MEM_INST_RETIRED:LOADS"] -
741 ( it->second )["MEM_INST_RETIRED:STORES"] - ( it->second )["BR_INST_RETIRED:ALL_BRANCHES"];
742 ( it->second )["Packed UOPS Retired"] =
743 ( it->second )["SSEX_UOPS_RETIRED:PACKED_DOUBLE"] + ( it->second )["SSEX_UOPS_RETIRED:PACKED_SINGLE"];
744 ( it->second )["CPI"] = ( it->second )["CPU_CLK_UNHALTED:THREAD_P"] / ( it->second )["INST_RETIRED:ANY_P"];
745
746 double localPerformanceImprovement = ( it->second )["CPI"] / EXPECTED_CPI;
747 double cyclesAfterImprovement = ( it->second )["CPU_CLK_UNHALTED:THREAD_P"] / localPerformanceImprovement;
748 double totalCyclesAfterImprovement =
749 totalCycles - ( it->second )["CPU_CLK_UNHALTED:THREAD_P"] + cyclesAfterImprovement;
750 ( it->second )["iMargin"] = 100 - ( totalCyclesAfterImprovement / totalCycles ) * 100;
751
752 ( it->second )["Load % of all Instructions"] =
753 ( it->second )["MEM_INST_RETIRED:LOADS"] * 100 / ( it->second )["INST_RETIRED:ANY_P"];
754 ( it->second )["Store % of all Instructions"] =
755 ( it->second )["MEM_INST_RETIRED:STORES"] * 100 / ( it->second )["INST_RETIRED:ANY_P"];
756 ( it->second )["Branch % of all Instructions"] =
757 ( it->second )["BR_INST_RETIRED:ALL_BRANCHES"] * 100 / ( it->second )["INST_RETIRED:ANY_P"];
758 ( it->second )["Other % of all Instructions"] =
759 ( it->second )["Other Instructions"] * 100 / ( it->second )["INST_RETIRED:ANY_P"];
760
761 ( it->second )["Packed % of all UOPS Retired"] =
762 ( it->second )["Packed UOPS Retired"] * 100 / ( it->second )["UOPS_RETIRED:ANY"];
763 }
764 }
I7_L3_UNSHARED_HIT_CYCLES
#define I7_L3_UNSHARED_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:51
I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES
#define I7_L3_MISS_REMOTE_DRAM_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:55
I7_IFETCH_L2_MISS_L3_HITM
#define I7_IFETCH_L2_MISS_L3_HITM
Definition: pfm_gen_analysis.cpp:61
EXPECTED_CPI
#define EXPECTED_CPI
Definition: pfm_gen_analysis.cpp:66
I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD
#define I7_IFETCH_L3_MISS_REMOTE_CACHE_FWD
Definition: pfm_gen_analysis.cpp:62
I7_OTHER_CORE_L2_HITM_CYCLES
#define I7_OTHER_CORE_L2_HITM_CYCLES
Definition: pfm_gen_analysis.cpp:53
std::map
STL class.
std::string
STL class.
I7_L1_ITLB_WALK_COMPLETED_CYCLES
#define I7_L1_ITLB_WALK_COMPLETED_CYCLES
Definition: pfm_gen_analysis.cpp:49
I7_L2_HIT_CYCLES
#define I7_L2_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:50
I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES
#define I7_L3_MISS_LOCAL_DRAM_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:54
I7_OTHER_CORE_L2_HIT_CYCLES
#define I7_OTHER_CORE_L2_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:52
I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES
#define I7_L3_MISS_REMOTE_CACHE_HIT_CYCLES
Definition: pfm_gen_analysis.cpp:56
I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP
#define I7_IFETCH_L2_MISS_L3_HIT_NO_SNOOP
Definition: pfm_gen_analysis.cpp:59
I7_L1_DTLB_WALK_COMPLETED_CYCLES
#define I7_L1_DTLB_WALK_COMPLETED_CYCLES
Definition: pfm_gen_analysis.cpp:48
I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT
#define I7_IFETCH_L3_MISS_LOCAL_DRAM_HIT
Definition: pfm_gen_analysis.cpp:57
I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT
#define I7_IFETCH_L3_MISS_REMOTE_DRAM_HIT
Definition: pfm_gen_analysis.cpp:58
I7_IFETCH_L2_MISS_L3_HIT_SNOOP
#define I7_IFETCH_L2_MISS_L3_HIT_SNOOP
Definition: pfm_gen_analysis.cpp:60

## ◆ calc_post_deriv_values()

void calc_post_deriv_values | ( |  | ) |

Definition at line 1554 of file pfm_gen_analysis.cpp.

1554 {
1555 if ( nehalem ) {
1556 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1557 ++it ) {
1558 double simdnorm =
1559 1. - normalize( "Packed % of all UOPS Retired", ( it->second )["Packed % of all UOPS Retired"], 1 );
1560 double misspnorm = normalize( "% of Mispredicted Branches", ( it->second )["% of Mispredicted Branches"], 1 );
1561 double stallnorm = normalize( "Stalled Cycles", ( it->second )["Stalled Cycles"], 1 );
1562 ( it->second )["iFactor"] = stallnorm * ( simdnorm + misspnorm + stallnorm );
1563 }
1564 } else {
1565 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1566 ++it ) {
1567 double simdnorm =
1568 1. - normalize( "Packed SIMD % of all Instructions", ( it->second )["Packed SIMD % of all Instructions"], 1 );
1569 double misspnorm = normalize( "% of Mispredicted Branches", ( it->second )["% of Mispredicted Branches"], 1 );
1570 double stallnorm = normalize( "Stalled Cycles", ( it->second )["Stalled Cycles"], 1 );
1571 ( it->second )["iFactor"] = stallnorm * ( simdnorm + misspnorm + stallnorm );
1572 }
1573 }
1574 }
normalize
double normalize(std::string field, double value, double normalizeTo)
Definition: pfm_gen_analysis.cpp:1535
std::map
STL class.
std::string
STL class.

## ◆ check_for_core_caa_events()

bool check_for_core_caa_events | ( |  | ) |

Definition at line 342 of file pfm_gen_analysis.cpp.

342 {
343 for ( std::vector<std::string>::const_iterator it = core_caa_events.begin(); it != core_caa_events.end(); ++it ) {
344 if ( find( C_events.begin(), C_events.end(), ( *it ) ) == C_events.end() ) {
345 fprintf( stderr, "ERROR: Cannot find event %s!!!\naborting...\n", ( *it ).c_str() );
346 return false;
347 }
348 }
349 return true;
350 }
std::vector::end
T end(T... args)
std::find
T find(T... args)
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ check_for_nhm_caa_events()

bool check_for_nhm_caa_events | ( |  | ) |

Definition at line 352 of file pfm_gen_analysis.cpp.

352 {
353 for ( std::vector<std::string>::const_iterator it = nhm_caa_events.begin(); it != nhm_caa_events.end(); ++it ) {
354 if ( find( C_events.begin(), C_events.end(), ( *it ) ) == C_events.end() ) {
355 fprintf( stderr, "ERROR: Cannot find event %s!!!\naborting...\n", ( *it ).c_str() );
356 return false;
357 }
358 }
359 return true;
360 }
std::vector::end
T end(T... args)
std::find
T find(T... args)
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ finalize_S_html_pages()

int finalize_S_html_pages | ( | const char * | dir | ) |

Definition at line 1347 of file pfm_gen_analysis.cpp.

1347 {
1348 for ( std::map<std::string, unsigned int>::const_iterator i = modules_tot_samples.begin();
1349 i != modules_tot_samples.end(); i++ ) {
1350 char module_filename[MAX_FILENAME_LENGTH];
1351 strcpy( module_filename, dir );
1352 strcat( module_filename, "/HTML/" );
1353 strcat( module_filename, ( i->first ).c_str() );
1354 strcat( module_filename, ".html" );
1355 FILE* module_file = fopen( module_filename, "a" );
1356 if ( module_file == NULL ) {
1357 fprintf( stderr, "ERROR: Unable to append to file: %s\naborting...\n", module_filename );
1358 exit( 1 );
1359 }
1360 fprintf( module_file, "</body>\n</html>\n" );
1361 if ( fclose( module_file ) ) {
1362 fprintf( stderr, "ERROR: Cannot close file %s!!!\naborting...\n", module_filename );
1363 exit( 1 );
1364 }
1365 }
1366 return 0;
1367 }
std::strcat
T strcat(T... args)
std::map::end
T end(T... args)
std::map
STL class.
std::fclose
T fclose(T... args)
std::exit
T exit(T... args)
std::fopen
T fopen(T... args)
MAX_FILENAME_LENGTH
#define MAX_FILENAME_LENGTH
Definition: pfm_gen_analysis.cpp:68
std::strcpy
T strcpy(T... args)
std::map::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ func_name()

const char* func_name | ( | const char * | demangled_symbol | ) |

Definition at line 859 of file pfm_gen_analysis.cpp.

859 {
860 char* operator_string_begin = const_cast<char*>( strstr( demangled_symbol, "operator" ) );
861 if ( operator_string_begin != NULL ) {
862 char* operator_string_end = operator_string_begin + 8;
863 while ( *operator_string_end == ' ' ) operator_string_end++;
864 if ( strstr( operator_string_end, "delete[]" ) == operator_string_end ) {
865 operator_string_end += 8;
866 *operator_string_end = '\0';
867 } else if ( strstr( operator_string_end, "delete" ) == operator_string_end ) {
868 operator_string_end += 6;
869 *operator_string_end = '\0';
870 } else if ( strstr( operator_string_end, "new[]" ) == operator_string_end ) {
871 operator_string_end += 5;
872 *operator_string_end = '\0';
873 } else if ( strstr( operator_string_end, "new" ) == operator_string_end ) {
874 operator_string_end += 3;
875 *operator_string_end = '\0';
876 } else if ( strstr( operator_string_end, ">>=" ) == operator_string_end ) {
877 operator_string_end += 3;
878 *operator_string_end = '\0';
879 } else if ( strstr( operator_string_end, "<<=" ) == operator_string_end ) {
880 operator_string_end += 3;
881 *operator_string_end = '\0';
882 } else if ( strstr( operator_string_end, "->*" ) == operator_string_end ) {
883 operator_string_end += 3;
884 *operator_string_end = '\0';
885 } else if ( strstr( operator_string_end, "<<" ) == operator_string_end ) {
886 operator_string_end += 2;
887 *operator_string_end = '\0';
888 } else if ( strstr( operator_string_end, ">>" ) == operator_string_end ) {
889 operator_string_end += 2;
890 *operator_string_end = '\0';
891 } else if ( strstr( operator_string_end, ">=" ) == operator_string_end ) {
892 operator_string_end += 2;
893 *operator_string_end = '\0';
894 } else if ( strstr( operator_string_end, "<=" ) == operator_string_end ) {
895 operator_string_end += 2;
896 *operator_string_end = '\0';
897 } else if ( strstr( operator_string_end, "==" ) == operator_string_end ) {
898 operator_string_end += 2;
899 *operator_string_end = '\0';
900 } else if ( strstr( operator_string_end, "!=" ) == operator_string_end ) {
901 operator_string_end += 2;
902 *operator_string_end = '\0';
903 } else if ( strstr( operator_string_end, "|=" ) == operator_string_end ) {
904 operator_string_end += 2;
905 *operator_string_end = '\0';
906 } else if ( strstr( operator_string_end, "&=" ) == operator_string_end ) {
907 operator_string_end += 2;
908 *operator_string_end = '\0';
909 } else if ( strstr( operator_string_end, "^=" ) == operator_string_end ) {
910 operator_string_end += 2;
911 *operator_string_end = '\0';
912 } else if ( strstr( operator_string_end, "%=" ) == operator_string_end ) {
913 operator_string_end += 2;
914 *operator_string_end = '\0';
915 } else if ( strstr( operator_string_end, "/=" ) == operator_string_end ) {
916 operator_string_end += 2;
917 *operator_string_end = '\0';
918 } else if ( strstr( operator_string_end, "*=" ) == operator_string_end ) {
919 operator_string_end += 2;
920 *operator_string_end = '\0';
921 } else if ( strstr( operator_string_end, "-=" ) == operator_string_end ) {
922 operator_string_end += 2;
923 *operator_string_end = '\0';
924 } else if ( strstr( operator_string_end, "+=" ) == operator_string_end ) {
925 operator_string_end += 2;
926 *operator_string_end = '\0';
927 } else if ( strstr( operator_string_end, "&&" ) == operator_string_end ) {
928 operator_string_end += 2;
929 *operator_string_end = '\0';
930 } else if ( strstr( operator_string_end, "||" ) == operator_string_end ) {
931 operator_string_end += 2;
932 *operator_string_end = '\0';
933 } else if ( strstr( operator_string_end, "[]" ) == operator_string_end ) {
934 operator_string_end += 2;
935 *operator_string_end = '\0';
936 } else if ( strstr( operator_string_end, "()" ) == operator_string_end ) {
937 operator_string_end += 2;
938 *operator_string_end = '\0';
939 } else if ( strstr( operator_string_end, "++" ) == operator_string_end ) {
940 operator_string_end += 2;
941 *operator_string_end = '\0';
942 } else if ( strstr( operator_string_end, "--" ) == operator_string_end ) {
943 operator_string_end += 2;
944 *operator_string_end = '\0';
945 } else if ( strstr( operator_string_end, "->" ) == operator_string_end ) {
946 operator_string_end += 2;
947 *operator_string_end = '\0';
948 } else if ( strstr( operator_string_end, "<" ) == operator_string_end ) {
949 operator_string_end += 1;
950 *operator_string_end = '\0';
951 } else if ( strstr( operator_string_end, ">" ) == operator_string_end ) {
952 operator_string_end += 1;
953 *operator_string_end = '\0';
954 } else if ( strstr( operator_string_end, "~" ) == operator_string_end ) {
955 operator_string_end += 1;
956 *operator_string_end = '\0';
957 } else if ( strstr( operator_string_end, "!" ) == operator_string_end ) {
958 operator_string_end += 1;
959 *operator_string_end = '\0';
960 } else if ( strstr( operator_string_end, "+" ) == operator_string_end ) {
961 operator_string_end += 1;
962 *operator_string_end = '\0';
963 } else if ( strstr( operator_string_end, "-" ) == operator_string_end ) {
964 operator_string_end += 1;
965 *operator_string_end = '\0';
966 } else if ( strstr( operator_string_end, "*" ) == operator_string_end ) {
967 operator_string_end += 1;
968 *operator_string_end = '\0';
969 } else if ( strstr( operator_string_end, "/" ) == operator_string_end ) {
970 operator_string_end += 1;
971 *operator_string_end = '\0';
972 } else if ( strstr( operator_string_end, "%" ) == operator_string_end ) {
973 operator_string_end += 1;
974 *operator_string_end = '\0';
975 } else if ( strstr( operator_string_end, "^" ) == operator_string_end ) {
976 operator_string_end += 1;
977 *operator_string_end = '\0';
978 } else if ( strstr( operator_string_end, "&" ) == operator_string_end ) {
979 operator_string_end += 1;
980 *operator_string_end = '\0';
981 } else if ( strstr( operator_string_end, "|" ) == operator_string_end ) {
982 operator_string_end += 1;
983 *operator_string_end = '\0';
984 } else if ( strstr( operator_string_end, "," ) == operator_string_end ) {
985 operator_string_end += 1;
986 *operator_string_end = '\0';
987 } else if ( strstr( operator_string_end, "=" ) == operator_string_end ) {
988 operator_string_end += 1;
989 *operator_string_end = '\0';
990 }
991 return operator_string_begin;
992 }
993 char* end_of_demangled_name = const_cast<char*>( strrchr( demangled_symbol, ')' ) );
994 if ( end_of_demangled_name != NULL ) {
995 int pars = 1;
996 char c;
997 while ( pars > 0 && end_of_demangled_name != demangled_symbol ) {
998 c = *( --end_of_demangled_name );
999 if ( c == ')' ) {
1000 pars++;
1001 } else if ( c == '(' ) {
1002 pars--;
1003 }
1004 }
1005 } else {
1006 return demangled_symbol;
1007 }
1008 char* end_of_func_name = end_of_demangled_name;
1009 if ( end_of_func_name != NULL ) {
1010 *end_of_func_name = '\0';
1011 char c = *( --end_of_func_name );
1012 if ( c == '>' ) {
1013 int pars = 1;
1014 while ( pars > 0 && end_of_func_name != demangled_symbol ) {
1015 c = *( --end_of_func_name );
1016 if ( c == '>' ) {
1017 pars++;
1018 } else if ( c == '<' ) {
1019 pars--;
1020 }
1021 }
1022 *end_of_func_name = '\0';
1023 }
1024 c = *( --end_of_func_name );
1025 while ( isalnum( c ) || c == '_' || c == '~' ) { c = *( --end_of_func_name ); }
1026 return ++end_of_func_name;
1027 }
1028 return demangled_symbol;
1029 }
gaudirun.c
c
Definition: gaudirun.py:487
std::isalnum
T isalnum(T... args)
std::strrchr
T strrchr(T... args)
std::strstr
T strstr(T... args)

## ◆ getTotalCycles()

double getTotalCycles | ( |  | ) |

Definition at line 1580 of file pfm_gen_analysis.cpp.

1580 {
1581 double sum = 0;
1582 if ( nehalem ) {
1583 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1584 ++it ) {
1585 sum += ( it->second )["CPU_CLK_UNHALTED:THREAD_P"];
1586 }
1587 } else {
1588 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1589 ++it ) {
1590 sum += ( it->second )["UNHALTED_CORE_CYCLES"];
1591 }
1592 }
1593 return sum;
1594 }
std::map
STL class.
std::string
STL class.

## ◆ html_special_chars()

void html_special_chars | ( | const char * | s,
|  | char * | s_mod
| ) |  |

Definition at line 828 of file pfm_gen_analysis.cpp.

828 {
829 int n = strlen( s );
830 *s_mod = '\0';
831 for ( int i = 0; i < n; i++ ) {
832 switch ( s[i] ) {
833 case '<':
834 strcat( s_mod, "&lt;" );
835 break;
836 case '>':
837 strcat( s_mod, "&gt;" );
838 break;
839 case '&':
840 strcat( s_mod, "&amp;" );
841 break;
842 case '"':
843 strcat( s_mod, "&quot;" );
844 break;
845 default:
846 char to_app[2];
847 to_app[0] = s[i];
848 to_app[1] = '\0';
849 strcat( s_mod, to_app );
850 break;
851 }
852 }
853 return;
854 }
std::strcat
T strcat(T... args)
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
std::strlen
T strlen(T... args)
gaudirun.s
string s
Definition: gaudirun.py:316

## ◆ init_core_caa_events()

void init_core_caa_events | ( |  | ) |

Definition at line 274 of file pfm_gen_analysis.cpp.

274 {
275 core_caa_events.push_back( "BRANCH_INSTRUCTIONS_RETIRED" );
276 core_caa_events.push_back( "ILD_STALL" );
277 core_caa_events.push_back( "INST_RETIRED:LOADS" );
278 core_caa_events.push_back( "INST_RETIRED:OTHER" );
279 core_caa_events.push_back( "INST_RETIRED:STORES" );
280 core_caa_events.push_back( "INSTRUCTIONS_RETIRED" );
281 core_caa_events.push_back( "LOAD_BLOCK:OVERLAP_STORE" );
282 core_caa_events.push_back( "LOAD_BLOCK:STA" );
283 core_caa_events.push_back( "LOAD_BLOCK:UNTIL_RETIRE" );
284 core_caa_events.push_back( "MEM_LOAD_RETIRED:DTLB_MISS" );
285 core_caa_events.push_back( "MEM_LOAD_RETIRED:L1D_LINE_MISS" );
286 core_caa_events.push_back( "MEM_LOAD_RETIRED:L2_LINE_MISS" );
287 core_caa_events.push_back( "MISPREDICTED_BRANCH_RETIRED" );
288 // core_caa_events.push_back("RS_UOPS_DISPATCHED");
289 // core_caa_events.push_back("RS_UOPS_DISPATCHED CMASK=1");
290 core_caa_events.push_back( "RS_UOPS_DISPATCHED CMASK=1 INV=1" );
291 core_caa_events.push_back( "SIMD_COMP_INST_RETIRED:PACKED_SINGLE:PACKED_DOUBLE" );
292 core_caa_events.push_back( "UNHALTED_CORE_CYCLES" );
293 // core_caa_events.push_back("UOPS_RETIRED:ANY");
294 // core_caa_events.push_back("UOPS_RETIRED:FUSED");
295 // core_caa_events.push_back("IDLE_DURING_DIV");
296 }
std::vector::push_back
T push_back(T... args)

## ◆ init_core_caa_events_displ()

void init_core_caa_events_displ | ( |  | ) |

Definition at line 362 of file pfm_gen_analysis.cpp.

362 {
363 core_caa_events_displ.push_back( "Total Cycles" );
364 core_caa_events_displ.push_back( "Stalled Cycles" );
365 core_caa_events_displ.push_back( "% of Total Cycles" );
366 core_caa_events_displ.push_back( "Instructions Retired" );
367 core_caa_events_displ.push_back( "CPI" );
368 core_caa_events_displ.push_back( "" );
369 core_caa_events_displ.push_back( "iMargin" );
370 core_caa_events_displ.push_back( "iFactor" );
371 core_caa_events_displ.push_back( "" );
372 core_caa_events_displ.push_back( "Counted Stalled Cycles" );
373 core_caa_events_displ.push_back( "" );
374 core_caa_events_displ.push_back( "L2 Miss Impact" );
375 core_caa_events_displ.push_back( "L2 Miss % of counted Stalled Cycles" );
376 core_caa_events_displ.push_back( "" );
377 core_caa_events_displ.push_back( "L2 Hit Impact" );
378 core_caa_events_displ.push_back( "L2 Hit % of counted Stalled Cycles" );
379 core_caa_events_displ.push_back( "" );
380 core_caa_events_displ.push_back( "L1 DTLB Miss Impact" );
381 core_caa_events_displ.push_back( "L1 DTLB Miss % of counted Stalled Cycles" );
382 core_caa_events_displ.push_back( "" );
383 core_caa_events_displ.push_back( "LCP Stalls Impact" );
384 core_caa_events_displ.push_back( "LCP Stalls % of counted Stalled Cycles" );
385 core_caa_events_displ.push_back( "" );
386 core_caa_events_displ.push_back( "Store-Fwd Stalls Impact" );
387 core_caa_events_displ.push_back( "Store-Fwd Stalls % of counted Stalled Cycles" );
388 core_caa_events_displ.push_back( "" );
389 core_caa_events_displ.push_back( "Loads Blocked by Unknown Address Store Impact" );
390 core_caa_events_displ.push_back( "Loads Blocked % of Store-Fwd Stalls Cycles" );
391 core_caa_events_displ.push_back( "Loads Overlapped with Stores Impact" );
392 core_caa_events_displ.push_back( "Loads Overlapped % of Store-Fwd Stalls Cycles" );
393 core_caa_events_displ.push_back( "Loads Spanning across Cache Lines Impact" );
394 core_caa_events_displ.push_back( "Loads Spanning % of Store-Fwd Stalls Cycles" );
395 core_caa_events_displ.push_back( "" );
396 core_caa_events_displ.push_back( "Load Instructions" );
397 core_caa_events_displ.push_back( "Load % of all Instructions" );
398 core_caa_events_displ.push_back( "Store Instructions" );
399 core_caa_events_displ.push_back( "Store % of all Instructions" );
400 core_caa_events_displ.push_back( "Branch Instructions" );
401 core_caa_events_displ.push_back( "Branch % of all Instructions" );
402 core_caa_events_displ.push_back( "Packed SIMD Computational Instructions" );
403 core_caa_events_displ.push_back( "Packed SIMD % of all Instructions" );
404 core_caa_events_displ.push_back( "Other Instructions" );
405 core_caa_events_displ.push_back( "Other % of all Instructions" );
406 core_caa_events_displ.push_back( "" );
407 core_caa_events_displ.push_back( "ITLB Miss Rate in %" );
408 core_caa_events_displ.push_back( "% of Mispredicted Branches" );
409 }
std::vector::push_back
T push_back(T... args)

## ◆ init_nhm_caa_events()

void init_nhm_caa_events | ( |  | ) |

Definition at line 298 of file pfm_gen_analysis.cpp.

298 {
299 nhm_caa_events.push_back( "ARITH:CYCLES_DIV_BUSY" );
300 nhm_caa_events.push_back( "BR_INST_EXEC:ANY" );
301 nhm_caa_events.push_back( "BR_INST_EXEC:DIRECT_NEAR_CALL" );
302 nhm_caa_events.push_back( "BR_INST_EXEC:INDIRECT_NEAR_CALL" );
303 nhm_caa_events.push_back( "BR_INST_EXEC:INDIRECT_NON_CALL" );
304 nhm_caa_events.push_back( "BR_INST_EXEC:NEAR_CALLS" );
305 nhm_caa_events.push_back( "BR_INST_EXEC:NON_CALLS" );
306 nhm_caa_events.push_back( "BR_INST_EXEC:RETURN_NEAR" );
307 nhm_caa_events.push_back( "BR_INST_RETIRED:ALL_BRANCHES" );
308 nhm_caa_events.push_back( "BR_INST_RETIRED:CONDITIONAL" );
309 nhm_caa_events.push_back( "BR_INST_RETIRED:NEAR_CALL" );
310 nhm_caa_events.push_back( "BR_MISP_EXEC:ANY" );
311 nhm_caa_events.push_back( "CPU_CLK_UNHALTED:THREAD_P" );
312 nhm_caa_events.push_back( "DTLB_LOAD_MISSES:WALK_COMPLETED" );
313 nhm_caa_events.push_back( "INST_RETIRED:ANY_P" );
314 nhm_caa_events.push_back( "ITLB_MISSES:WALK_COMPLETED" );
315 nhm_caa_events.push_back( "L2_RQSTS:IFETCH_HIT" );
316 nhm_caa_events.push_back( "L2_RQSTS:IFETCH_MISS" );
317 nhm_caa_events.push_back( "MEM_INST_RETIRED:LOADS" );
318 nhm_caa_events.push_back( "MEM_INST_RETIRED:STORES" );
319 nhm_caa_events.push_back( "MEM_LOAD_RETIRED:L2_HIT" );
320 nhm_caa_events.push_back( "MEM_LOAD_RETIRED:L3_MISS" );
321 nhm_caa_events.push_back( "MEM_LOAD_RETIRED:L3_UNSHARED_HIT" );
322 nhm_caa_events.push_back( "MEM_LOAD_RETIRED:OTHER_CORE_L2_HIT_HITM" );
323 nhm_caa_events.push_back( "MEM_UNCORE_RETIRED:LOCAL_DRAM" );
324 nhm_caa_events.push_back( "MEM_UNCORE_RETIRED:OTHER_CORE_L2_HITM" );
325 nhm_caa_events.push_back( "MEM_UNCORE_RETIRED:REMOTE_CACHE_LOCAL_HOME_HIT" );
326 nhm_caa_events.push_back( "MEM_UNCORE_RETIRED:REMOTE_DRAM" );
327 nhm_caa_events.push_back( "OFFCORE_RESPONSE_0:DMND_IFETCH:LOCAL_DRAM" );
328 nhm_caa_events.push_back( "OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HITM" );
329 nhm_caa_events.push_back( "OFFCORE_RESPONSE_0:DMND_IFETCH:OTHER_CORE_HIT_SNP" );
330 nhm_caa_events.push_back( "OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_CACHE_FWD" );
331 nhm_caa_events.push_back( "OFFCORE_RESPONSE_0:DMND_IFETCH:REMOTE_DRAM" );
332 nhm_caa_events.push_back( "OFFCORE_RESPONSE_0:DMND_IFETCH:UNCORE_HIT" );
333 nhm_caa_events.push_back( "RESOURCE_STALLS:ANY" );
334 nhm_caa_events.push_back( "SSEX_UOPS_RETIRED:PACKED_DOUBLE" );
335 nhm_caa_events.push_back( "SSEX_UOPS_RETIRED:PACKED_SINGLE" );
336 nhm_caa_events.push_back( "UOPS_DECODED:MS CMASK=1" );
337 nhm_caa_events.push_back( "UOPS_ISSUED:ANY CMASK=1 INV=1" );
338 nhm_caa_events.push_back( "ITLB_MISS_RETIRED" );
339 nhm_caa_events.push_back( "UOPS_RETIRED:ANY" );
340 }
std::vector::push_back
T push_back(T... args)

## ◆ init_nhm_caa_events_displ()

void init_nhm_caa_events_displ | ( |  | ) |

Definition at line 492 of file pfm_gen_analysis.cpp.

492 {
493 nhm_caa_events_displ.push_back( "Total Cycles" );
494 nhm_caa_events_displ.push_back( "Instructions Retired" );
495 nhm_caa_events_displ.push_back( "CPI" );
496 nhm_caa_events_displ.push_back( "" );
497 nhm_caa_events_displ.push_back( "iMargin" );
498 nhm_caa_events_displ.push_back( "iFactor" );
499 nhm_caa_events_displ.push_back( "" );
500 nhm_caa_events_displ.push_back( "Stalled Cycles" );
501 nhm_caa_events_displ.push_back( "% of Total Cycles" );
502 nhm_caa_events_displ.push_back( "Total Counted Stalled Cycles" );
503 nhm_caa_events_displ.push_back( "" );
504 nhm_caa_events_displ.push_back( "Instruction Starvation % of Total Cycles" );
505 nhm_caa_events_displ.push_back( "# of Instructions per Call" );
506 nhm_caa_events_displ.push_back( "% of Total Cycles spent handling FP exceptions" );
507 nhm_caa_events_displ.push_back( "" );
508 nhm_caa_events_displ.push_back( "Counted Stalled Cycles due to Load Ops" );
509 nhm_caa_events_displ.push_back( "" );
510 nhm_caa_events_displ.push_back( "L2 Hit Impact" );
511 nhm_caa_events_displ.push_back( "L2 Hit % of Load Stalls" );
512 nhm_caa_events_displ.push_back( "" );
513 nhm_caa_events_displ.push_back( "L3 Unshared Hit Impact" );
514 nhm_caa_events_displ.push_back( "L3 Unshared Hit % of Load Stalls" );
515 nhm_caa_events_displ.push_back( "" );
516 nhm_caa_events_displ.push_back( "L2 Other Core Hit Impact" );
517 nhm_caa_events_displ.push_back( "L2 Other Core Hit % of Load Stalls" );
518 nhm_caa_events_displ.push_back( "" );
519 nhm_caa_events_displ.push_back( "L2 Other Core Hit Modified Impact" );
520 nhm_caa_events_displ.push_back( "L2 Other Core Hit Modified % of Load Stalls" );
521 nhm_caa_events_displ.push_back( "" );
522 nhm_caa_events_displ.push_back( "L3 Miss -> Local DRAM Hit Impact" );
523 nhm_caa_events_displ.push_back( "L3 Miss -> Remote DRAM Hit Impact" );
524 nhm_caa_events_displ.push_back( "L3 Miss -> Remote Cache Hit Impact" );
525 nhm_caa_events_displ.push_back( "L3 Miss -> Total Impact" );
526 nhm_caa_events_displ.push_back( "L3 Miss % of Load Stalls" );
527 nhm_caa_events_displ.push_back( "" );
528 nhm_caa_events_displ.push_back( "L1 DTLB Miss Impact" );
529 nhm_caa_events_displ.push_back( "L1 DTLB Miss % of Load Stalls" );
530 nhm_caa_events_displ.push_back( "" );
531 nhm_caa_events_displ.push_back( "Cycles spent during DIV & SQRT Ops" );
532 nhm_caa_events_displ.push_back( "DIV & SQRT Ops % of counted Stalled Cycles" );
533 nhm_caa_events_displ.push_back( "" );
534 nhm_caa_events_displ.push_back( "Total L2 IFETCH misses" );
535 nhm_caa_events_displ.push_back( "% of L2 IFETCH misses" );
536 nhm_caa_events_displ.push_back( "" );
537 nhm_caa_events_displ.push_back( "% of IFETCHes served by Local DRAM" );
538 nhm_caa_events_displ.push_back( "% of IFETCHes served by L3 (Modified)" );
539 nhm_caa_events_displ.push_back( "% of IFETCHes served by L3 (Clean Snoop)" );
540 nhm_caa_events_displ.push_back( "% of IFETCHes served by Remote L2" );
541 nhm_caa_events_displ.push_back( "% of IFETCHes served by Remote DRAM" );
542 nhm_caa_events_displ.push_back( "% of IFETCHes served by L3 (No Snoop)" );
543 nhm_caa_events_displ.push_back( "" );
544 nhm_caa_events_displ.push_back( "Total L2 IFETCH miss Impact" );
545 nhm_caa_events_displ.push_back( "" );
546 nhm_caa_events_displ.push_back( "Cycles IFETCH served by Local DRAM" );
547 nhm_caa_events_displ.push_back( "Local DRAM IFECTHes % Impact" );
548 nhm_caa_events_displ.push_back( "" );
549 nhm_caa_events_displ.push_back( "Cycles IFETCH served by L3 (Modified)" );
550 nhm_caa_events_displ.push_back( "L3 (Modified) IFECTHes % Impact" );
551 nhm_caa_events_displ.push_back( "" );
552 nhm_caa_events_displ.push_back( "Cycles IFETCH served by L3 (Clean Snoop)" );
553 nhm_caa_events_displ.push_back( "L3 (Clean Snoop) IFECTHes % Impact" );
554 nhm_caa_events_displ.push_back( "" );
555 nhm_caa_events_displ.push_back( "Cycles IFETCH served by Remote L2" );
556 nhm_caa_events_displ.push_back( "Remote L2 IFECTHes % Impact" );
557 nhm_caa_events_displ.push_back( "" );
558 nhm_caa_events_displ.push_back( "Cycles IFETCH served by Remote DRAM" );
559 nhm_caa_events_displ.push_back( "Remote DRAM IFECTHes % Impact" );
560 nhm_caa_events_displ.push_back( "" );
561 nhm_caa_events_displ.push_back( "Cycles IFETCH served by L3 (No Snoop)" );
562 nhm_caa_events_displ.push_back( "L3 (No Snoop) IFECTHes % Impact" );
563 nhm_caa_events_displ.push_back( "" );
564 nhm_caa_events_displ.push_back( "Total Branch Instructions Executed" );
565 nhm_caa_events_displ.push_back( "% of Mispredicted Branches" );
566 nhm_caa_events_displ.push_back( "" );
567 nhm_caa_events_displ.push_back( "Direct Near Calls % of Total Branches Executed" );
568 nhm_caa_events_displ.push_back( "Indirect Near Calls % of Total Branches Executed" );
569 nhm_caa_events_displ.push_back( "Indirect Near Non-Calls % of Total Branches Executed" );
570 nhm_caa_events_displ.push_back( "All Near Calls % of Total Branches Executed" );
571 nhm_caa_events_displ.push_back( "All Non Calls % of Total Branches Executed" );
572 nhm_caa_events_displ.push_back( "All Returns % of Total Branches Executed" );
573 nhm_caa_events_displ.push_back( "" );
574 nhm_caa_events_displ.push_back( "Total Branch Instructions Retired" );
575 nhm_caa_events_displ.push_back( "Conditionals % of Total Branches Retired" );
576 nhm_caa_events_displ.push_back( "Near Calls % of Total Branches Retired" );
577 nhm_caa_events_displ.push_back( "" );
578 nhm_caa_events_displ.push_back( "L1 ITLB Miss Impact" );
579 nhm_caa_events_displ.push_back( "ITLB Miss Rate in %" );
580 nhm_caa_events_displ.push_back( "" );
581 nhm_caa_events_displ.push_back( "Branch Instructions" );
582 nhm_caa_events_displ.push_back( "Branch % of all Instructions" );
583 nhm_caa_events_displ.push_back( "" );
584 nhm_caa_events_displ.push_back( "Load Instructions" );
585 nhm_caa_events_displ.push_back( "Load % of all Instructions" );
586 nhm_caa_events_displ.push_back( "" );
587 nhm_caa_events_displ.push_back( "Store Instructions" );
588 nhm_caa_events_displ.push_back( "Store % of all Instructions" );
589 nhm_caa_events_displ.push_back( "" );
590 nhm_caa_events_displ.push_back( "Other Instructions" );
591 nhm_caa_events_displ.push_back( "Other % of all Instructions" );
592 nhm_caa_events_displ.push_back( "" );
593 nhm_caa_events_displ.push_back( "Packed UOPS Retired" );
594 nhm_caa_events_displ.push_back( "Packed % of all UOPS Retired" );
595 }
std::vector::push_back
T push_back(T... args)

## ◆ main()

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Definition at line 1599 of file pfm_gen_analysis.cpp.

1599 {
1600 if ( argc < 2 || argc > 4 ) {
1601 printf( "\n\nUsage: %s DIRECTORY [--caa] [--csv]\n\n", argv[0] );
1602 exit( 1 );
1603 }
1604
1605 bool caa = false;
1606 bool csv = false;
1607 for ( int i = 2; i < argc; i++ ) {
1608 if ( !strcmp( argv[i], "--caa" ) ) caa = true;
1609 if ( !strcmp( argv[i], "--csv" ) ) csv = true;
1610 }
1611
1612 char dir[MAX_FILENAME_LENGTH];
1613 strcpy( dir, argv[1] );
1614 if ( !csv ) {
1615 strcat( dir, "/HTML" );
1616 int res = mkdir( dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH );
1617 if ( res != 0 ) {
1618 fprintf( stderr, "ERROR: Cannot create directory %s\naborting...\n", dir );
1619 exit( 1 );
1620 }
1621 }
1622
1623 DIR* dp;
1624 struct dirent* dirp;
1625 int num_of_modules = 0;
1626 if ( ( dp = opendir( argv[1] ) ) == NULL ) {
1627 printf( "Error(%d) opening %s\n", errno, argv[1] );
1628 return errno;
1629 }
1630 while ( ( dirp = readdir( dp ) ) != NULL ) {
1631 if ( strstr( dirp->d_name, "_S_" ) != NULL && strstr( dirp->d_name, ".txt.gz" ) != NULL && !csv ) {
1632 if ( read_S_events( argv[1], dirp->d_name ) ) {
1633 fprintf( stderr, "ERROR: Cannot read file %s\naborting...\n", dirp->d_name );
1634 exit( 1 );
1635 }
1636 }
1637 }
1638 closedir( dp );
1639 sort( S_events.begin(), S_events.end() );
1640 if ( ( dp = opendir( argv[1] ) ) == NULL ) {
1641 printf( "Error(%d) opening %s\n", errno, argv[1] );
1642 return errno;
1643 }
1644 while ( ( dirp = readdir( dp ) ) != NULL ) {
1645 if ( strstr( dirp->d_name, "_S_" ) != NULL && strstr( dirp->d_name, ".txt.gz" ) != NULL && !csv ) {
1646 if ( read_S_file( argv[1], dirp->d_name ) ) {
1647 fprintf( stderr, "ERROR: Cannot read file %s\naborting...\n", dirp->d_name );
1648 exit( 1 );
1649 }
1650 } else if ( strstr( dirp->d_name, "_C_" ) != NULL && strstr( dirp->d_name, ".txt" ) != NULL ) {
1651 int res = read_C_file( argv[1], dirp->d_name );
1652 if ( res > num_of_modules ) { num_of_modules = res; }
1653 }
1654 }
1655 closedir( dp );
1656
1657 if ( !csv ) {
1658 if ( finalize_S_html_pages( argv[1] ) ) {
1659 fprintf( stderr, "ERROR: Cannot finalize HTML pages!!!\naborting...\n" );
1660 exit( 1 );
1661 }
1662 }
1663
1664 char filepath[MAX_FILENAME_LENGTH];
1665 bzero( filepath, MAX_FILENAME_LENGTH );
1666 if ( !csv )
1667 sprintf( filepath, "%s/HTML/index.html", argv[1] );
1668 else
1669 sprintf( filepath, "%s/results.csv", argv[1] );
1670 FILE* fp = fopen( filepath, "w" );
1671 if ( fp == NULL ) {
1672 fprintf( stderr, "ERROR: Cannot create file index.html!!!\naborting...\n" );
1673 exit( 1 );
1674 }
1675
1676 if ( caa ) {
1677 double totalCycles;
1678 if ( !nehalem ) {
1679 init_core_caa_events();
1680 if ( !check_for_core_caa_events() ) {
1681 fprintf( stderr, "(core) ERROR: One or more events for CAA missing!\naborting...\n" );
1682 exit( 1 );
1683 }
1684 init_core_caa_events_displ();
1685 totalCycles = getTotalCycles();
1686 calc_core_deriv_values( totalCycles );
1687 calc_post_deriv_values();
1688 if ( !csv ) {
1689 put_C_header( fp, core_caa_events_displ );
1690 put_C_modules( fp, core_caa_events_displ );
1691 } else {
1692 put_C_header_csv( fp, core_caa_events_displ );
1693 put_C_modules_csv( fp, core_caa_events_displ );
1694 }
1695 } else {
1696 init_nhm_caa_events();
1697 if ( !check_for_nhm_caa_events() ) {
1698 fprintf( stderr, "(nehalem) ERROR: One or more events for CAA missing!\naborting...\n" );
1699 exit( 1 );
1700 }
1701 init_nhm_caa_events_displ();
1702 totalCycles = getTotalCycles();
1703 calc_nhm_deriv_values( totalCycles );
1704 calc_post_deriv_values();
1705 if ( !csv ) {
1706 put_C_header( fp, nhm_caa_events_displ );
1707 put_C_modules( fp, nhm_caa_events_displ );
1708 } else {
1709 put_C_header_csv( fp, nhm_caa_events_displ );
1710 put_C_modules_csv( fp, nhm_caa_events_displ );
1711 }
1712 }
1713 if ( !csv ) put_C_footer( fp );
1714 fclose( fp );
1715 } else {
1716 if ( !csv ) {
1717 put_C_header( fp, C_events );
1718 put_C_modules( fp, C_events );
1719 put_C_footer( fp );
1720 } else {
1721 put_C_header_csv( fp, C_events );
1722 put_C_modules_csv( fp, C_events );
1723 }
1724 fclose( fp );
1725 }
1726 if ( !csv ) {
1727 char src[MAX_FILENAME_LENGTH];
1728 char dst[MAX_FILENAME_LENGTH];
1729 sprintf( src, "sorttable.js" );
1730 sprintf( dst, "%s/HTML/sorttable.js", argv[1] );
1731 int fd_src = open( src, O_RDONLY );
1732 if ( fd_src == -1 ) {
1733 fprintf( stderr, "ERROR: Cannot open file \"%s\"!\naborting...\n", src );
1734 exit( 1 );
1735 }
1736 int fd_dst = open( dst, O_WRONLY | O_CREAT | O_TRUNC, 0644 );
1737 if ( fd_dst == -1 ) {
1738 fprintf( stderr, "ERROR: Cannot open file \"%s\" (%s)!\naborting...\n", dst, strerror( errno ) );
1739 exit( 1 );
1740 }
1741 char c;
1742 while ( read( fd_src, &c, 1 ) ) {
1743 if ( write( fd_dst, &c, 1 ) == -1 ) {
1744 std::cerr << "ERROR: failed to write to " << dst << std::endl;
1745 exit( 1 );
1746 }
1747 }
1748 close( fd_dst );
1749 close( fd_src );
1750 }
1751 return 0;
1752 }
gaudirun.c
c
Definition: gaudirun.py:487
std::strcat
T strcat(T... args)
put_C_footer
void put_C_footer(FILE *fp)
Definition: pfm_gen_analysis.cpp:1494
std::strerror
T strerror(T... args)
init_core_caa_events_displ
void init_core_caa_events_displ()
Definition: pfm_gen_analysis.cpp:362
put_C_modules
void put_C_modules(FILE *fp, std::vector< std::string > &columns)
Definition: pfm_gen_analysis.cpp:1467
gaudirun.argv
list argv
Definition: gaudirun.py:298
std::endl
T endl(T... args)
init_core_caa_events
void init_core_caa_events()
Definition: pfm_gen_analysis.cpp:274
hivetimeline.read
def read(f, regex='.*', skipevents=0)
Definition: hivetimeline.py:22
read_S_file
int read_S_file(const char *dir, const char *filename)
Definition: pfm_gen_analysis.cpp:1188
check_for_nhm_caa_events
bool check_for_nhm_caa_events()
Definition: pfm_gen_analysis.cpp:352
std::vector::end
T end(T... args)
calc_post_deriv_values
void calc_post_deriv_values()
Definition: pfm_gen_analysis.cpp:1554
calc_nhm_deriv_values
void calc_nhm_deriv_values(double totalCycles)
Definition: pfm_gen_analysis.cpp:597
init_nhm_caa_events_displ
void init_nhm_caa_events_displ()
Definition: pfm_gen_analysis.cpp:492
finalize_S_html_pages
int finalize_S_html_pages(const char *dir)
Definition: pfm_gen_analysis.cpp:1347
std::fclose
T fclose(T... args)
put_C_header
void put_C_header(FILE *fp, std::vector< std::string > &columns)
Definition: pfm_gen_analysis.cpp:1438
init_nhm_caa_events
void init_nhm_caa_events()
Definition: pfm_gen_analysis.cpp:298
calc_core_deriv_values
void calc_core_deriv_values(double totalCycles)
Definition: pfm_gen_analysis.cpp:411
std::exit
T exit(T... args)
std::strcmp
T strcmp(T... args)
std::fopen
T fopen(T... args)
read_S_events
int read_S_events(const char *dir, const char *filename)
Definition: pfm_gen_analysis.cpp:1301
MAX_FILENAME_LENGTH
#define MAX_FILENAME_LENGTH
Definition: pfm_gen_analysis.cpp:68
std::strcpy
T strcpy(T... args)
plotBacklogPyRoot.argc
argc
Definition: plotBacklogPyRoot.py:142
put_C_header_csv
void put_C_header_csv(FILE *fp, std::vector< std::string > &columns)
Definition: pfm_gen_analysis.cpp:1499
ReadAndWriteWhiteBoard.dst
dst
Definition: ReadAndWriteWhiteBoard.py:17
std::vector::begin
T begin(T... args)
check_for_core_caa_events
bool check_for_core_caa_events()
Definition: pfm_gen_analysis.cpp:342
std::strstr
T strstr(T... args)
getTotalCycles
double getTotalCycles()
Definition: pfm_gen_analysis.cpp:1580
std::sort
T sort(T... args)
put_C_modules_csv
void put_C_modules_csv(FILE *fp, std::vector< std::string > &columns)
Definition: pfm_gen_analysis.cpp:1510
std::printf
T printf(T... args)
std::cerr
read_C_file
int read_C_file(const char *dir, const char *filename)
Definition: pfm_gen_analysis.cpp:1373

## ◆ normalize()

double normalize | ( | std::string | field,
|  | double | value,
|  | double | normalizeTo
| ) |  |

Definition at line 1535 of file pfm_gen_analysis.cpp.

1535 {
1536 double max = 0;
1537 double counter_value;
1538 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1539 ++it ) {
1540 counter_value = ( it->second )[field];
1541 if ( max < counter_value ) max = counter_value;
1542 }
1543 if ( value > 0 && max > 0 && normalizeTo > 0 ) {
1544 return 1. * value / max * normalizeTo;
1545 } else
1546 return 0;
1547 }
max
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:215
std::map
STL class.
std::string
STL class.

## ◆ put_C_footer()

void put_C_footer | ( | FILE * | fp | ) |

Definition at line 1494 of file pfm_gen_analysis.cpp.

1494 {
1495 fprintf( fp, "</table>\n</body>\n</html>\n" );
1496 return;
1497 }
std::fprintf
T fprintf(T... args)

## ◆ put_C_header()

void put_C_header | ( | FILE * | fp,
|  | std::vector< std::string > & | columns
| ) |  |

Definition at line 1438 of file pfm_gen_analysis.cpp.

1438 {
1439 fprintf(
1440 fp,
1441 "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" );
1442 fprintf( fp, "<html>\n" );
1443 fprintf( fp, "<head>\n" );
1444 fprintf( fp, "<title>\n" );
1445 fprintf( fp, "Analysis Result\n" );
1446 fprintf( fp, "</title>\n" );
1447 fprintf( fp, "<script src=\"sorttable.js\"></script>\n" );
1448 fprintf( fp, "<style>\ntable.sortable thead "
1449 "{\nbackground-color:#eee;\ncolor:#666666;\nfont-weight:bold;\ncursor:default;\nfont-family:courier;\n}"
1450 "\n</style>\n" );
1451 fprintf( fp, "</head>\n" );
1452 fprintf( fp, "<body link=\"black\">\n" );
1453 fprintf( fp, "<h1>RESULTS:</h1><br/>Click for detailed symbol view...<p/>\n" );
1454 fprintf( fp, "<table class=\"sortable\" cellpadding=\"5\">\n" );
1455 fprintf( fp, "<tr>\n" );
1456 fprintf( fp, "<th>MODULE NAME</th>\n" );
1457 for ( std::vector<std::string>::const_iterator it = columns.begin(); it != columns.end(); ++it ) {
1458 if ( strlen( it->c_str() ) == 0 )
1459 fprintf( fp, "<th bgcolor=\"#FFFFFF\">&nbsp;</th>\n" );
1460 else
1461 fprintf( fp, "<th>%s</th>\n", ( *it ).c_str() );
1462 }
1463 fprintf( fp, "</tr>\n" );
1464 return;
1465 }
std::vector::end
T end(T... args)
std::strlen
T strlen(T... args)
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ put_C_header_csv()

void put_C_header_csv | ( | FILE * | fp,
|  | std::vector< std::string > & | columns
| ) |  |

Definition at line 1499 of file pfm_gen_analysis.cpp.

1499 {
1500 fprintf( fp, "MODULE NAME" );
1501 for ( std::vector<std::string>::const_iterator it = columns.begin(); it != columns.end(); ++it ) {
1502 if ( strlen( it->c_str() ) == 0 ) {
1503 } else
1504 fprintf( fp, ",%s", ( *it ).c_str() );
1505 }
1506 fprintf( fp, "\n" );
1507 return;
1508 }
std::vector::end
T end(T... args)
std::strlen
T strlen(T... args)
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ put_C_modules()

void put_C_modules | ( | FILE * | fp,
|  | std::vector< std::string > & | columns
| ) |  |

Definition at line 1467 of file pfm_gen_analysis.cpp.

1467 {
1468 int index = 0;
1469 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1470 ++it ) {
1471 if ( index % 2 )
1472 fprintf( fp, "<tr bgcolor=\"#FFFFCC\">\n" );
1473 else
1474 fprintf( fp, "<tr bgcolor=\"#CCFFCC\">\n" );
1475 fprintf( fp, "<td style=\"font-family:monospace;font-size:large;color:Black\"><a href=\"%s.html\">%s</a></td>\n",
1476 ( it->first ).c_str(), ( it->first ).c_str() );
1477 for ( std::vector<std::string>::const_iterator jt = columns.begin(); jt != columns.end(); ++jt ) {
1478 if ( strlen( jt->c_str() ) == 0 ) {
1479 fprintf( fp, "<td bgcolor=\"#FFFFFF\">&nbsp;</td>" );
1480 } else {
1481 if ( ( it->second ).find( *jt ) == ( it->second ).end() ) {
1482 fprintf( stderr, "ERROR: Cannot find derivate value \"%s\"!!!\naborting...\n", ( *jt ).c_str() );
1483 exit( 1 );
1484 }
1485 fprintf( fp, "<td style=\"font-family:monospace;font-size:large;color:DarkBlue\" align=\"right\">%.2f</td>\n",
1486 ( it->second )[*jt] );
1487 }
1488 }
1489 fprintf( fp, "</tr>\n" );
1490 index++;
1491 }
1492 }
std::vector::end
T end(T... args)
std::map
STL class.
std::string
STL class.
std::exit
T exit(T... args)
std::strlen
T strlen(T... args)
IOTest.end
def end
Definition: IOTest.py:112
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ put_C_modules_csv()

void put_C_modules_csv | ( | FILE * | fp,
|  | std::vector< std::string > & | columns
| ) |  |

Definition at line 1510 of file pfm_gen_analysis.cpp.

1510 {
1511 for ( std::map<std::string, std::map<std::string, double>>::iterator it = C_modules.begin(); it != C_modules.end();
1512 ++it ) {
1513 fprintf( fp, "%s", ( it->first ).c_str() );
1514 for ( std::vector<std::string>::const_iterator jt = columns.begin(); jt != columns.end(); ++jt ) {
1515 if ( strlen( jt->c_str() ) == 0 ) {
1516 } else {
1517 if ( ( it->second ).find( *jt ) == ( it->second ).end() ) {
1518 fprintf( stderr, "ERROR: Cannot find derivate value \"%s\"!!!\naborting...\n", ( *jt ).c_str() );
1519 exit( 1 );
1520 }
1521 fprintf( fp, ",%.2f", ( it->second )[*jt] );
1522 }
1523 }
1524 fprintf( fp, "\n" );
1525 }
1526 }
std::vector::end
T end(T... args)
std::map
STL class.
std::string
STL class.
std::exit
T exit(T... args)
std::strlen
T strlen(T... args)
IOTest.end
def end
Definition: IOTest.py:112
std::vector
STL class.
std::vector::begin
T begin(T... args)
std::fprintf
T fprintf(T... args)

## ◆ put_S_module()

void put_S_module | ( | S_module * | cur_module,
|  | const char * | dir
| ) |  |

Definition at line 1036 of file pfm_gen_analysis.cpp.

1036 {
1037 char module_name[MAX_MODULE_NAME_LENGTH];
1038 bzero( module_name, MAX_MODULE_NAME_LENGTH );
1039 strcpy( module_name, ( cur_module->get_module_name() ).c_str() );
1040 char module_filename[MAX_FILENAME_LENGTH];
1041 bzero( module_filename, MAX_FILENAME_LENGTH );
1042 strcpy( module_filename, dir );
1043 strcat( module_filename, "/HTML/" );
1044 strcat( module_filename, module_name );
1045 strcat( module_filename, ".html" );
1046 char event[MAX_EVENT_NAME_LENGTH];
1047 bzero( event, MAX_EVENT_NAME_LENGTH );
1048 strcpy( event, ( cur_module->get_event() ).c_str() );
1049 std::map<std::string, unsigned int>::iterator result = modules_tot_samples.find( cur_module->get_module_name() );
1050 FILE* module_file;
1051 if ( result == modules_tot_samples.end() ) // not found
1052 {
1053 if ( ( !strcmp( event, "UNHALTED_CORE_CYCLES" ) && !nehalem ) ||
1054 ( !strcmp( event, "CPU_CLK_UNHALTED:THREAD_P" ) && nehalem ) ) {
1055 modules_tot_samples.insert(
1056 std::pair<std::string, unsigned int>( cur_module->get_module_name(), cur_module->get_total_num_samples() ) );
1057 } else {
1058 modules_tot_samples.insert( std::pair<std::string, unsigned int>( cur_module->get_module_name(), 0 ) );
1059 }
1060 module_file = fopen( module_filename, "w" );
1061 if ( module_file == NULL ) {
1062 fprintf( stderr, "ERROR: Cannot create file %s!!!\naborting...\n", module_filename );
1063 exit( 1 );
1064 }
1065 fprintf( module_file, "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" "
1066 "\"http://www.w3.org/TR/html4/loose.dtd\">\n" );
1067 fprintf( module_file, "<html>\n" );
1068 fprintf( module_file, "<head>\n" );
1069 fprintf( module_file, "<title>\n" );
1070 fprintf( module_file, "%s\n", module_name );
1071 fprintf( module_file, "</title>\n" );
1072 fprintf( module_file, "</head>\n" );
1073 fprintf( module_file, "<body>\n" );
1074 fprintf( module_file, "<h2>%s</h2><br/>Events Sampled:<br/>\n", module_name );
1075 fprintf( module_file, "<ul>\n" );
1076 for ( std::vector<std::string>::const_iterator it = S_events.begin(); it != S_events.end(); ++it ) {
1077 fprintf( module_file, "<li><a href=\"#%s\">%s</a></li>\n", it->c_str(), it->c_str() );
1078 }
1079 fprintf( module_file, "</ul>\n" );
1080 } // if(result == modules_tot_samples.end()) //not found
1081 else {
1082 if ( ( !strcmp( event, "UNHALTED_CORE_CYCLES" ) && !nehalem ) ||
1083 ( !strcmp( event, "CPU_CLK_UNHALTED:THREAD_P" ) && nehalem ) ) {
1084 modules_tot_samples[cur_module->get_module_name()] = cur_module->get_total_num_samples();
1085 }
1086 module_file = fopen( module_filename, "a" );
1087 } // else:: if(result != modules_tot_samples.end()) //found!!
1088 char event_str[MAX_EVENT_NAME_LENGTH];
1089 bzero( event_str, MAX_EVENT_NAME_LENGTH );
1090 strcpy( event_str, event );
1091 if ( cur_module->get_c_mask() > 0 ) {
1092 sprintf( event_str + strlen( event_str ), " CMASK=%d", cur_module->get_c_mask() );
1093 }
1094 if ( cur_module->get_inv_mask() > 0 ) {
1095 sprintf( event_str + strlen( event_str ), " INV=%d", cur_module->get_inv_mask() );
1096 }
1097 fprintf( module_file, "<a name=\"%s\"><a>\n", event_str );
1098 fprintf( module_file, "<table cellpadding=\"5\">\n" );
1099 fprintf( module_file, "<tr bgcolor=\"#EEEEEE\">\n" );
1100 fprintf( module_file,
1101 "<th colspan=\"6\" align=\"left\">%s -- cmask: %u -- invmask: %u -- Total Samples: %u -- "
1102 "Sampling Period: %d</th>\n",
1103 event, cur_module->get_c_mask(), cur_module->get_inv_mask(), cur_module->get_total_num_samples(),
1104 cur_module->get_smpl_period() );
1105 fprintf( module_file, "</tr>\n" );
1106 fprintf( module_file, "<tr bgcolor=\"#EEEEEE\">\n" );
1107 fprintf( module_file, "<th align=\"left\">Samples</th>\n" );
1108 fprintf( module_file, "<th align=\"left\">Percentage</th>\n" );
1109 fprintf( module_file, "<th align=\"left\">Symbol Name</th>\n" );
1110 fprintf( module_file, "<th align=\"left\">Library Name</th>\n" );
1111 fprintf( module_file, "<th align=\"left\">Complete Signature</th>\n" );
1112 fprintf( module_file, "<th align=\"left\">Library Pathname</th>\n" );
1113 fprintf( module_file, "</tr>\n" );
1114 for ( int j = 0; j < 20; j++ ) {
1115 char sym[MAX_SYM_LENGTH];
1116 char sym_mod[MAX_SYM_MOD_LENGTH];
1117 char lib[MAX_LIB_LENGTH];
1118 char lib_mod[MAX_LIB_MOD_LENGTH];
1119 char simple_sym[MAX_SIMPLE_SYM_LENGTH];
1120 char simple_sym_mod[MAX_SIMPLE_SYM_MOD_LENGTH];
1121 char simple_lib[MAX_SIMPLE_LIB_LENGTH];
1122 char simple_lib_mod[MAX_SIMPLE_LIB_MOD_LENGTH];
1123
1124 bzero( sym, MAX_SYM_LENGTH );
1125 bzero( sym_mod, MAX_SYM_MOD_LENGTH );
1126 bzero( lib, MAX_LIB_LENGTH );
1127 bzero( lib_mod, MAX_LIB_MOD_LENGTH );
1128 bzero( simple_sym, MAX_SIMPLE_SYM_LENGTH );
1129 bzero( simple_sym_mod, MAX_SIMPLE_SYM_MOD_LENGTH );
1130 bzero( simple_lib, MAX_SIMPLE_LIB_LENGTH );
1131 bzero( simple_lib_mod, MAX_SIMPLE_LIB_MOD_LENGTH );
1132
1133 char index[MAX_SAMPLE_INDEX_LENGTH];
1134 bzero( index, MAX_SAMPLE_INDEX_LENGTH );
1135 unsigned int value;
1136 bool res = cur_module->get_max( index, value );
1137 if ( !res ) break;
1138 char* sym_end = strchr( index, '%' );
1139 if ( sym_end == NULL ) // error
1140 {
1141 fprintf( stderr, "ERROR: Invalid sym and lib name! : %s\naborting...\n", index );
1142 exit( 1 );
1143 }
1144 memcpy( sym, index, strlen( index ) - strlen( sym_end ) );
1145 strcpy( lib, sym_end + 1 );
1146 char temp[MAX_SYM_LENGTH];
1147 bzero( temp, MAX_SYM_LENGTH );
1148 strcpy( temp, sym );
1149 strcpy( simple_sym, ( func_name( temp ) ) );
1150 if ( strrchr( lib, '/' ) != NULL && *( strrchr( lib, '/' ) + 1 ) != '\0' ) {
1151 strcpy( simple_lib, strrchr( lib, '/' ) + 1 );
1152 } else {
1153 strcpy( simple_lib, lib );
1154 }
1155 if ( j % 2 != 0 ) {
1156 fprintf( module_file, "<tr bgcolor=\"#FFFFCC\">\n" );
1157 } else {
1158 fprintf( module_file, "<tr bgcolor=\"#CCFFCC\">\n" );
1159 }
1160 fprintf( module_file, "<td style=\"font-family:monospace;font-size:large;color:DarkBlue\">%u</td>\n", value );
1161 fprintf( module_file, "<td style=\"font-family:monospace;font-size:large;color:DarkBlue\">%f%%</td>\n",
1162 ( ( (double)( value ) ) / ( (double)( cur_module->get_total_num_samples() ) ) ) * 100 );
1163 html_special_chars( simple_sym, simple_sym_mod );
1164 html_special_chars( simple_lib, simple_lib_mod );
1165 html_special_chars( sym, sym_mod );
1166 html_special_chars( lib, lib_mod );
1167 fprintf( module_file, "<td style=\"font-family:courier;\">%s</td>\n", simple_sym_mod );
1168 fprintf( module_file, "<td style=\"font-family:courier;\">%s</td>\n", simple_lib_mod );
1169 fprintf( module_file, "<td style=\"font-family:courier;\">%s</td>\n", sym_mod );
1170 fprintf( module_file, "<td style=\"font-family:courier;\">%s</td>\n</tr>\n", lib_mod );
1171 }
1172 fprintf( module_file, "</table><br/><br/>\n" );
1173 int res = fclose( module_file );
1174 if ( res ) {
1175 fprintf( stderr, "ERROR: Cannot close file %s!!!\naborting...\n", module_filename );
1176 exit( 1 );
1177 }
1178 return;
1179 }
MAX_EVENT_NAME_LENGTH
#define MAX_EVENT_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:79
S_module::get_inv_mask
unsigned int get_inv_mask()
Definition: pfm_gen_analysis.cpp:803
func_name
const char * func_name(const char *demangled_symbol)
Definition: pfm_gen_analysis.cpp:859
MAX_SAMPLE_INDEX_LENGTH
#define MAX_SAMPLE_INDEX_LENGTH
Definition: pfm_gen_analysis.cpp:69
std::strcat
T strcat(T... args)
MAX_LIB_LENGTH
#define MAX_LIB_LENGTH
Definition: pfm_gen_analysis.cpp:72
MAX_SYM_LENGTH
#define MAX_SYM_LENGTH
Definition: pfm_gen_analysis.cpp:70
std::map::end
T end(T... args)
S_module::get_smpl_period
unsigned int get_smpl_period()
Definition: pfm_gen_analysis.cpp:802
std::map
STL class.
MAX_SIMPLE_SYM_LENGTH
#define MAX_SIMPLE_SYM_LENGTH
Definition: pfm_gen_analysis.cpp:74
MAX_LIB_MOD_LENGTH
#define MAX_LIB_MOD_LENGTH
Definition: pfm_gen_analysis.cpp:73
std::fclose
T fclose(T... args)
MAX_SIMPLE_LIB_MOD_LENGTH
#define MAX_SIMPLE_LIB_MOD_LENGTH
Definition: pfm_gen_analysis.cpp:77
std::exit
T exit(T... args)
std::memcpy
T memcpy(T... args)
std::strlen
T strlen(T... args)
html_special_chars
void html_special_chars(const char *s, char *s_mod)
Definition: pfm_gen_analysis.cpp:828
std::strcmp
T strcmp(T... args)
std::fopen
T fopen(T... args)
std::strrchr
T strrchr(T... args)
MAX_FILENAME_LENGTH
#define MAX_FILENAME_LENGTH
Definition: pfm_gen_analysis.cpp:68
std::strcpy
T strcpy(T... args)
std::pair
std::map::insert
T insert(T... args)
std::map::find
T find(T... args)
std::vector
STL class.
MAX_SIMPLE_SYM_MOD_LENGTH
#define MAX_SIMPLE_SYM_MOD_LENGTH
Definition: pfm_gen_analysis.cpp:75
std::vector::begin
T begin(T... args)
S_module::get_event
std::string get_event()
Definition: pfm_gen_analysis.cpp:806
S_module::get_total_num_samples
unsigned int get_total_num_samples()
Definition: pfm_gen_analysis.cpp:821
MAX_MODULE_NAME_LENGTH
#define MAX_MODULE_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:80
MAX_SIMPLE_LIB_LENGTH
#define MAX_SIMPLE_LIB_LENGTH
Definition: pfm_gen_analysis.cpp:76
std::fprintf
T fprintf(T... args)
S_module::get_max
bool get_max(char *index, unsigned int &value)
Definition: pfm_gen_analysis.cpp:811
S_module::get_module_name
std::string get_module_name()
Definition: pfm_gen_analysis.cpp:820
MAX_SYM_MOD_LENGTH
#define MAX_SYM_MOD_LENGTH
Definition: pfm_gen_analysis.cpp:71
std::strchr
T strchr(T... args)
S_module::get_c_mask
unsigned int get_c_mask()
Definition: pfm_gen_analysis.cpp:804

## ◆ read_C_file()

int read_C_file | ( | const char * | dir,
|  | const char * | filename
| ) |  |

Definition at line 1373 of file pfm_gen_analysis.cpp.

1373 {
1374 char event[MAX_EVENT_NAME_LENGTH];
1375 char arch[MAX_ARCH_NAME_LENGTH];
1376 char line[MAX_LINE_LENGTH];
1377 char cmask_str[MAX_CMASK_STR_LENGTH];
1378 char inv_str[MAX_INV_STR_LENGTH];
1379 char sp_str[MAX_SP_STR_LENGTH];
1380 char cur_module_name[MAX_MODULE_NAME_LENGTH];
1381 bzero( line, MAX_LINE_LENGTH );
1382 bzero( event, MAX_EVENT_NAME_LENGTH );
1383 bzero( cur_module_name, MAX_MODULE_NAME_LENGTH );
1384 bzero( arch, MAX_ARCH_NAME_LENGTH );
1385 bzero( line, MAX_LINE_LENGTH );
1386 bzero( cmask_str, MAX_CMASK_STR_LENGTH );
1387 bzero( inv_str, MAX_INV_STR_LENGTH );
1388 bzero( sp_str, MAX_SP_STR_LENGTH );
1389 int number_of_modules = 0;
1390 long cur_sum = 0;
1391 int no_of_values = 0;
1392 char path_name[MAX_FILENAME_LENGTH];
1393 bzero( path_name, MAX_FILENAME_LENGTH );
1394 strcpy( path_name, dir );
1395 strcat( path_name, "/" );
1396 strcat( path_name, filename );
1397 FILE* fp = fopen( path_name, "r" );
1398 int stat = fscanf( fp, "%s %s %s %s %s\n", arch, event, cmask_str, inv_str, sp_str );
1399 if ( stat != 5 ) {
1400 std::cerr << "ERROR: failed to parse " << path_name << std::endl;
1401 exit( 1 );
1402 }
1403 if ( !strcmp( arch, "NHM" ) )
1404 nehalem = true;
1405 else
1406 nehalem = false;
1407 std::string event_str( event );
1408 if ( atoi( cmask_str ) > 0 ) {
1409 event_str += " CMASK=";
1410 event_str += cmask_str;
1411 }
1412 if ( atoi( inv_str ) > 0 ) {
1413 event_str += " INV=";
1414 event_str += inv_str;
1415 }
1416 C_events.push_back( event_str );
1417 while ( fscanf( fp, "%s\n", line ) != EOF ) {
1418 if ( isalpha( line[0] ) ) // module
1419 {
1420 if ( number_of_modules > 0 ) {
1421 C_modules[cur_module_name][event_str] = (double)cur_sum / no_of_values;
1422 cur_sum = 0;
1423 no_of_values = 0;
1424 }
1425 strcpy( cur_module_name, line );
1426 number_of_modules++;
1427 } else if ( isdigit( line[0] ) ) // value
1428 {
1429 cur_sum += strtol( line, NULL, 10 );
1430 no_of_values++;
1431 }
1432 }
1433 C_modules[cur_module_name][event_str] = (double)cur_sum / no_of_values; // last module
1434 fclose( fp );
1435 return number_of_modules;
1436 }
MAX_EVENT_NAME_LENGTH
#define MAX_EVENT_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:79
std::atoi
T atoi(T... args)
std::strcat
T strcat(T... args)
std::isalpha
T isalpha(T... args)
std::fscanf
T fscanf(T... args)
std::endl
T endl(T... args)
graphanalysis.filename
string filename
Definition: graphanalysis.py:119
MAX_ARCH_NAME_LENGTH
#define MAX_ARCH_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:82
MAX_LINE_LENGTH
#define MAX_LINE_LENGTH
Definition: pfm_gen_analysis.cpp:78
std::fclose
T fclose(T... args)
std::string
STL class.
std::vector::push_back
T push_back(T... args)
MAX_SP_STR_LENGTH
#define MAX_SP_STR_LENGTH
Definition: pfm_gen_analysis.cpp:85
std::exit
T exit(T... args)
std::isdigit
T isdigit(T... args)
std::strcmp
T strcmp(T... args)
std::fopen
T fopen(T... args)
MAX_CMASK_STR_LENGTH
#define MAX_CMASK_STR_LENGTH
Definition: pfm_gen_analysis.cpp:83
MAX_FILENAME_LENGTH
#define MAX_FILENAME_LENGTH
Definition: pfm_gen_analysis.cpp:68
std::strcpy
T strcpy(T... args)
MAX_INV_STR_LENGTH
#define MAX_INV_STR_LENGTH
Definition: pfm_gen_analysis.cpp:84
std::strtol
T strtol(T... args)
MAX_MODULE_NAME_LENGTH
#define MAX_MODULE_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:80
std::cerr
plotSpeedupsPyRoot.line
line
Definition: plotSpeedupsPyRoot.py:170

## ◆ read_S_events()

int read_S_events | ( | const char * | dir,
|  | const char * | filename
| ) |  |

Definition at line 1301 of file pfm_gen_analysis.cpp.

1301 {
1302 char event[MAX_EVENT_NAME_LENGTH];
1303 char arch[MAX_ARCH_NAME_LENGTH];
1304 char line[MAX_LINE_LENGTH];
1305 char cmask_str[MAX_CMASK_STR_LENGTH];
1306 char inv_str[MAX_INV_STR_LENGTH];
1307 char sp_str[MAX_SP_STR_LENGTH];
1308 bzero( line, MAX_LINE_LENGTH );
1309 bzero( event, MAX_EVENT_NAME_LENGTH );
1310 bzero( arch, MAX_ARCH_NAME_LENGTH );
1311 bzero( cmask_str, MAX_CMASK_STR_LENGTH );
1312 bzero( inv_str, MAX_INV_STR_LENGTH );
1313 bzero( sp_str, MAX_SP_STR_LENGTH );
1314 char path_name[MAX_FILENAME_LENGTH];
1315 bzero( path_name, MAX_FILENAME_LENGTH );
1316 strcpy( path_name, dir );
1317 strcat( path_name, "/" );
1318 strcat( path_name, filename );
1319 gzFile res_file = gzopen( path_name, "rb" );
1320 if ( res_file != NULL ) {
1321 bzero( line, MAX_LINE_LENGTH );
1322 gzgets( res_file, line, MAX_LINE_LENGTH );
1323 if ( line[strlen( line ) - 1] == '\n' ) line[strlen( line ) - 1] = '\0';
1324 bzero( event, MAX_EVENT_NAME_LENGTH );
1325 sscanf( line, "%s %s %s %s %s\n", arch, event, cmask_str, inv_str, sp_str );
1326 std::string event_str( event );
1327 if ( atoi( cmask_str ) > 0 ) {
1328 event_str += " CMASK=";
1329 event_str += cmask_str;
1330 }
1331 if ( atoi( inv_str ) > 0 ) {
1332 event_str += " INV=";
1333 event_str += inv_str;
1334 }
1335 S_events.push_back( event_str );
1336 } // if(res_file != NULL)
1337 else {
1338 fprintf( stderr, "ERROR: Unable to open input file: %s\naborting...\n", filename );
1339 exit( 1 );
1340 }
1341 return 0;
1342 }
MAX_EVENT_NAME_LENGTH
#define MAX_EVENT_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:79
std::atoi
T atoi(T... args)
std::strcat
T strcat(T... args)
std::sscanf
T sscanf(T... args)
graphanalysis.filename
string filename
Definition: graphanalysis.py:119
MAX_ARCH_NAME_LENGTH
#define MAX_ARCH_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:82
MAX_LINE_LENGTH
#define MAX_LINE_LENGTH
Definition: pfm_gen_analysis.cpp:78
std::string
STL class.
std::vector::push_back
T push_back(T... args)
MAX_SP_STR_LENGTH
#define MAX_SP_STR_LENGTH
Definition: pfm_gen_analysis.cpp:85
std::exit
T exit(T... args)
std::strlen
T strlen(T... args)
MAX_CMASK_STR_LENGTH
#define MAX_CMASK_STR_LENGTH
Definition: pfm_gen_analysis.cpp:83
MAX_FILENAME_LENGTH
#define MAX_FILENAME_LENGTH
Definition: pfm_gen_analysis.cpp:68
std::strcpy
T strcpy(T... args)
MAX_INV_STR_LENGTH
#define MAX_INV_STR_LENGTH
Definition: pfm_gen_analysis.cpp:84
std::fprintf
T fprintf(T... args)
plotSpeedupsPyRoot.line
line
Definition: plotSpeedupsPyRoot.py:170

## ◆ read_S_file()

int read_S_file | ( | const char * | dir,
|  | const char * | filename
| ) |  |

Definition at line 1188 of file pfm_gen_analysis.cpp.

1188 {
1189 char line[MAX_LINE_LENGTH];
1190 char event[MAX_EVENT_NAME_LENGTH];
1191 char arch[MAX_ARCH_NAME_LENGTH];
1192 unsigned int cmask;
1193 unsigned int inv;
1194 unsigned int sp;
1195 char cur_module_name[MAX_MODULE_NAME_LENGTH];
1196 bzero( line, MAX_LINE_LENGTH );
1197 bzero( event, MAX_EVENT_NAME_LENGTH );
1198 bzero( cur_module_name, MAX_MODULE_NAME_LENGTH );
1199 bzero( arch, MAX_ARCH_NAME_LENGTH );
1200
1201 S_module* cur_module = new S_module();
1202 unsigned int module_num = 0;
1203
1204 char path_name[MAX_FILENAME_LENGTH];
1205 bzero( path_name, MAX_FILENAME_LENGTH );
1206 strcpy( path_name, dir );
1207 strcat( path_name, "/" );
1208 strcat( path_name, filename );
1209 gzFile res_file = gzopen( path_name, "rb" );
1210
1211 if ( res_file != NULL ) {
1212 bzero( line, MAX_LINE_LENGTH );
1213 gzgets( res_file, line, MAX_LINE_LENGTH );
1214 if ( line[strlen( line ) - 1] == '\n' ) line[strlen( line ) - 1] = '\0';
1215 bzero( event, MAX_EVENT_NAME_LENGTH );
1216 sscanf( line, "%s %s %u %u %u", arch, event, &cmask, &inv, &sp );
1217 if ( !strcmp( arch, "NHM" ) )
1218 nehalem = true;
1219 else
1220 nehalem = false;
1221 bzero( line, MAX_LINE_LENGTH );
1222 while ( gzgets( res_file, line, MAX_LINE_LENGTH ) != Z_NULL ) {
1223 if ( line[strlen( line ) - 1] == '\n' ) line[strlen( line ) - 1] = '\0';
1224 if ( strchr( line, ' ' ) == NULL ) // module
1225 {
1226 if ( module_num > 0 ) {
1227 put_S_module( cur_module, dir );
1228 cur_module->clear();
1229 }
1230 module_num++;
1231 char* end_sym = strchr( line, '%' );
1232 if ( end_sym == NULL ) // error
1233 {
1234 fprintf( stderr, "ERROR: Invalid module name. \nLINE: %s\naborting...\n", line );
1235 exit( 1 );
1236 }
1237 bzero( cur_module_name, MAX_MODULE_NAME_LENGTH );
1238 memcpy( cur_module_name, line, strlen( line ) - strlen( end_sym ) );
1239 cur_module->init( cur_module_name, arch, event, cmask, inv, sp );
1240 cur_module->set_total( atoi( end_sym + 1 ) );
1241 } // module
1242 else // symbol, libName, libOffset, value
1243 {
1244 unsigned int value = 0, libOffset = 0;
1245 char symbol[MAX_SYM_LENGTH];
1246 char libName[MAX_LIB_LENGTH];
1247 char final_sym[MAX_SYM_MOD_LENGTH];
1248 char final_lib[MAX_LIB_MOD_LENGTH];
1249 bzero( symbol, MAX_SYM_LENGTH );
1250 bzero( libName, MAX_LIB_LENGTH );
1251 bzero( final_sym, MAX_SYM_MOD_LENGTH );
1252 bzero( final_lib, MAX_LIB_MOD_LENGTH );
1253
1254 sscanf( line, "%s %s %u %u", symbol, libName, &libOffset, &value );
1255 char realPathName_s[FILENAME_MAX];
1256 bzero( realPathName_s, FILENAME_MAX );
1257 char* realPathName = realpath( libName, realPathName_s );
1258 if ( realPathName != NULL && strlen( realPathName ) > 0 ) {
1259 std::map<std::string, FileInfo>::iterator result;
1260 result = libsInfo.find( realPathName );
1261 if ( result == libsInfo.end() ) { libsInfo[realPathName] = FileInfo( realPathName, true ); }
1262 const char* temp_sym = libsInfo[realPathName].symbolByOffset( libOffset );
1263 if ( temp_sym != NULL && strlen( temp_sym ) > 0 ) {
1264 int status;
1265 char* demangled_symbol = abi::__cxa_demangle( temp_sym, NULL, NULL, &status );
1266 if ( status == 0 ) {
1267 strcpy( final_sym, demangled_symbol );
1268 free( demangled_symbol );
1269 } else {
1270 strcpy( final_sym, temp_sym );
1271 }
1272 } else {
1273 strcpy( final_sym, "???" );
1274 }
1275 strcpy( final_lib, realPathName );
1276 } else {
1277 strcpy( final_sym, symbol );
1278 strcpy( final_lib, libName );
1279 }
1280 char index[MAX_LINE_LENGTH];
1281 bzero( index, MAX_LINE_LENGTH );
1282 strcpy( index, final_sym );
1283 strcat( index, "%" );
1284 strcat( index, final_lib );
1285 cur_module->add_sample( index, value );
1286 } // symbol, libName, libOffset, value
1287 bzero( line, MAX_LINE_LENGTH );
1288 } // while(gzgets(res_file, line, MAX_LINE_LENGTH)!=Z_NULL)
1289 put_S_module( cur_module, dir ); // last module!
1290 cur_module->clear();
1291 gzclose( res_file );
1292 } // if(res_file != NULL)
1293 else {
1294 fprintf( stderr, "ERROR: Unable to open input file: %s\naborting...\n", filename );
1295 exit( 1 );
1296 }
1297 delete cur_module; // delete it!
1298 return 0;
1299 }
MAX_EVENT_NAME_LENGTH
#define MAX_EVENT_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:79
std::atoi
T atoi(T... args)
FileInfo
Definition: pfm_gen_analysis.cpp:143
std::strcat
T strcat(T... args)
MAX_LIB_LENGTH
#define MAX_LIB_LENGTH
Definition: pfm_gen_analysis.cpp:72
std::sscanf
T sscanf(T... args)
put_S_module
void put_S_module(S_module *cur_module, const char *dir)
Definition: pfm_gen_analysis.cpp:1036
compareOutputFiles.sp
sp
Definition: compareOutputFiles.py:494
S_module
Definition: pfm_gen_analysis.cpp:767
MAX_SYM_LENGTH
#define MAX_SYM_LENGTH
Definition: pfm_gen_analysis.cpp:70
graphanalysis.filename
string filename
Definition: graphanalysis.py:119
MAX_ARCH_NAME_LENGTH
#define MAX_ARCH_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:82
S_module::add_sample
void add_sample(const char *index, unsigned int value)
Definition: pfm_gen_analysis.cpp:807
std::free
T free(T... args)
MAX_LINE_LENGTH
#define MAX_LINE_LENGTH
Definition: pfm_gen_analysis.cpp:78
boost::spirit
Definition: iter_pos.hpp:14
std::map
STL class.
MAX_LIB_MOD_LENGTH
#define MAX_LIB_MOD_LENGTH
Definition: pfm_gen_analysis.cpp:73
std::exit
T exit(T... args)
std::memcpy
T memcpy(T... args)
std::strlen
T strlen(T... args)
S_module::init
void init(const char *name, const char *architecture, const char *event_name, unsigned int c_mask, unsigned int inv_mask, unsigned int smpl_period)
Definition: pfm_gen_analysis.cpp:789
S_module::set_total
void set_total(unsigned int total)
Definition: pfm_gen_analysis.cpp:798
std::strcmp
T strcmp(T... args)
MAX_FILENAME_LENGTH
#define MAX_FILENAME_LENGTH
Definition: pfm_gen_analysis.cpp:68
std::strcpy
T strcpy(T... args)
S_module::clear
void clear()
Definition: pfm_gen_analysis.cpp:780
MAX_MODULE_NAME_LENGTH
#define MAX_MODULE_NAME_LENGTH
Definition: pfm_gen_analysis.cpp:80
std::fprintf
T fprintf(T... args)
plotSpeedupsPyRoot.line
line
Definition: plotSpeedupsPyRoot.py:170
MAX_SYM_MOD_LENGTH
#define MAX_SYM_MOD_LENGTH
Definition: pfm_gen_analysis.cpp:71
std::strchr
T strchr(T... args)

## ◆ skipString()

bool skipString | ( | const char * | strptr,
|  | const char * | srcbuffer,
|  | const char ** | dstbuffer
| ) |  |

Definition at line 137 of file pfm_gen_analysis.cpp.

137 {
138 if ( strncmp( srcbuffer, strptr, strlen( strptr ) ) ) { return false; }
139 *dstbuffer = srcbuffer + strlen( strptr );
140 return true;
141 }
std::strlen
T strlen(T... args)
std::strncmp
T strncmp(T... args)

## ◆ skipWhitespaces()

bool skipWhitespaces | ( | const char * | srcbuffer,
|  | const char ** | destbuffer
| ) |  |

Definition at line 123 of file pfm_gen_analysis.cpp.

123 {
124 if ( !isspace( *srcbuffer++ ) ) { return false; }
125 while ( isspace( *srcbuffer ) ) { srcbuffer++; }
126 *destbuffer = srcbuffer;
127 return true;
128 }
std::isspace
T isspace(T... args)