diff options
author | Glenn Miles <milesg@us.ibm.com> | 2015-05-01 12:50:06 -0500 |
---|---|---|
committer | Thi N. Tran <thi@us.ibm.com> | 2015-05-13 14:14:40 -0500 |
commit | a51afa0f5ea1320c0d55b0258eac6cfd64cd41cc (patch) | |
tree | f79bcf2377b055d266d767242a0975bd61b9fb2c | |
parent | 112940c6a761e1d3a1897bb4c07b924c3a3c8d21 (diff) | |
download | talos-sbe-a51afa0f5ea1320c0d55b0258eac6cfd64cd41cc.tar.gz talos-sbe-a51afa0f5ea1320c0d55b0258eac6cfd64cd41cc.zip |
ppetracepp tool: support coexisting with tracepp tool
Change-Id: Ia62df48af0e0722644cce8ce93c9b7473f747ae5
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/17562
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Tested-by: Thi N. Tran <thi@us.ibm.com>
-rw-r--r-- | pk/kernel/pk_api.h | 8 | ||||
-rw-r--r-- | pk/trace/pk_trace_core.c | 2 | ||||
-rwxr-xr-x | tools/ppetracepp/ppe2fsp | bin | 18842 -> 19306 bytes | |||
-rwxr-xr-x | tools/ppetracepp/ppetracepp | bin | 230947 -> 321115 bytes | |||
-rwxr-xr-x | tools/ppetracepp/ppetracepp.C | 38 |
5 files changed, 24 insertions, 24 deletions
diff --git a/pk/kernel/pk_api.h b/pk/kernel/pk_api.h index 7e1c9702..75515b8b 100644 --- a/pk/kernel/pk_api.h +++ b/pk/kernel/pk_api.h @@ -390,9 +390,9 @@ #define TINY_TRACE_ASM0() .error "format string required" #define TINY_TRACE_ASM1(str) \ - .tiny_trace_asm1 trace_adal_hash(str, PK_TRACE_HASH_PREFIX) + .tiny_trace_asm1 trace_ppe_hash(str, PK_TRACE_HASH_PREFIX) #define TINY_TRACE_ASM2(str, reg) \ - .tiny_trace_asm2 trace_adal_hash(str, PK_TRACE_HASH_PREFIX), reg + .tiny_trace_asm2 trace_ppe_hash(str, PK_TRACE_HASH_PREFIX), reg #define TINY_TRACE_ASM3() .error "too many parameters" #define TINY_TRACE_ASM4() .error "too many parameters" #define TINY_TRACE_ASM5() .error "too many parameters" @@ -483,12 +483,12 @@ typedef struct { /// Trace macros for C functions #define HASH_ARG_COMBO(str, arg) \ - ((((uint32_t)trace_adal_hash(str, PK_TRACE_HASH_PREFIX)) << 16) | ((uint32_t)(arg) & 0x0000ffff)) + ((((uint32_t)trace_ppe_hash(str, PK_TRACE_HASH_PREFIX)) << 16) | ((uint32_t)(arg) & 0x0000ffff)) #define PKTRACE0(...) pk_trace_tiny() //will fail at compile time #define PKTRACE1(str) \ - pk_trace_tiny((trace_adal_hash(str, PK_TRACE_HASH_PREFIX) << 16)) + pk_trace_tiny((trace_ppe_hash(str, PK_TRACE_HASH_PREFIX) << 16)) #define PKTRACE2(str, parm0) \ ((sizeof(parm0) <= 2)? \ diff --git a/pk/trace/pk_trace_core.c b/pk/trace/pk_trace_core.c index b70f7ed3..93072bd8 100644 --- a/pk/trace/pk_trace_core.c +++ b/pk/trace/pk_trace_core.c @@ -35,7 +35,7 @@ PkTraceBuffer g_pk_trace_buf = .version = PK_TRACE_VERSION, .image_str = PPE_IMG_STRING, .hash_prefix = PK_TRACE_HASH_PREFIX, - .partial_trace_hash = trace_adal_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX), + .partial_trace_hash = trace_ppe_hash("PARTIAL TRACE ENTRY. HASH_ID = %d", PK_TRACE_HASH_PREFIX), .size = PK_TRACE_SZ, .max_time_change = PK_TRACE_MTBT, .hz = 500000000, //default value. Actual value is set in pk_init.c diff --git a/tools/ppetracepp/ppe2fsp b/tools/ppetracepp/ppe2fsp Binary files differindex 4554ffff..ea96923f 100755 --- a/tools/ppetracepp/ppe2fsp +++ b/tools/ppetracepp/ppe2fsp diff --git a/tools/ppetracepp/ppetracepp b/tools/ppetracepp/ppetracepp Binary files differindex acf90492..61b5f04b 100755 --- a/tools/ppetracepp/ppetracepp +++ b/tools/ppetracepp/ppetracepp diff --git a/tools/ppetracepp/ppetracepp.C b/tools/ppetracepp/ppetracepp.C index c5378fe7..5c4b069f 100755 --- a/tools/ppetracepp/ppetracepp.C +++ b/tools/ppetracepp/ppetracepp.C @@ -2,7 +2,7 @@ /* # *** ppetracepp - a fsp/common Linux trace pre processor # this one replaces the trace strings by the corresponding hash value -# (i.e. the complete call to trace_adal_hash is replaced) +# (i.e. the complete call to trace_ppe_hash is replaced) # *** Usage # @@ -14,7 +14,7 @@ # you can set a env var "REALCPP" to the name of a program to select # a different programm as cpp # -# ppetracepp creates a file "$target.hash" with the trace strings and the hash values. +# ppetracepp creates a file "$target.ppe.hash" with the trace strings and the hash values. # # to enable debug mode set envvar PPETRACEPPDEBUG to 1 or give '-d' as first arg @@ -31,7 +31,7 @@ # it is obsolete and might lead to an error if afs is used # 2004-02-13 RBa add support for dependency generation (-MD/-MG, -MF) # don't prepend './' to object filename -# 2006-04-19 RBa rewrite trace_adal_write_all support, handle C and C++ the same +# 2006-04-19 RBa rewrite trace_ppe_write_all support, handle C and C++ the same # 2006-05-24 RBa fix handling of missing -o ; add TRAC_PPVER for macro/API version # 2006-09-15 RBa add handling of \" in trace format strings ; reduce non-error output # put object file in current dir if no -o given @@ -111,7 +111,7 @@ void fileparse(const string& in_str, string& name, string& dir, string& suff) dir = str; } -static const size_t TRACE_ADAL_HASH_LEN = 14; +static const size_t TRACE_PPE_HASH_LEN = 13; //***************************************************************************** // chop_up_line //***************************************************************************** @@ -120,20 +120,20 @@ bool chop_up_line(string& in_line, string& prefix, string& strings, string& salt // First see if this line matches the pattern we're looking for // Since this will return false 95%+ of the time this function it called, we do it // before doing any other init for performance reasons. - size_t pos = in_line.find("trace_adal_hash"); + size_t pos = in_line.find("trace_ppe_hash"); if (pos == string::npos) { return(false); } - // trace_adal_hash ( "..." ".." "..." , 2 ) - // regex: PREFIX 'trace_adal_hash' space '(' space STRINGS space ',' space NUMBER space ')' SUFFIX + // trace_ppe_hash ( "..." ".." "..." , 2 ) + // regex: PREFIX 'trace_ppe_hash' space '(' space STRINGS space ',' space NUMBER space ')' SUFFIX // STRINGS: '"' .* '"' space? + // Original perl magic incantation: - // while($line =~ m/^(.*?)trace_adal_hash\s*\(\s*((".*?(?<!\\)"\s*)+),\s*(-?\d+)\s*\)(.*)$/) { + // while($line =~ m/^(.*?)trace_ppe_hash\s*\(\s*((".*?(?<!\\)"\s*)+),\s*(-?\d+)\s*\)(.*)$/) { // ($prefix, $strings, $salt, $suffix) = ($1, $2, $4, $5); // // Decrypting the magic pattern matching... - // (.*?) => $1 = everything up to the word "trace_adal_hash" - // trace_adal_hash = delimiter + // (.*?) => $1 = everything up to the word "trace_ppe_hash" + // trace_ppe_hash = delimiter // \s*\(\s* = delimiter = <0-n whitespace chars>, left paren, <0-n whitespace chars> // ((".*?(?<!\\)"\s*)+) => $2 = double-quote, some chars up to last closing double-quote ($3 used for nested regex) // ,\s* = delimiter = comma followed by some whitespace @@ -148,7 +148,7 @@ bool chop_up_line(string& in_line, string& prefix, string& strings, string& salt size_t pos2; size_t pos3; - pos1 = pos + 15; // pos1 = after "trace_adal_hash" + pos1 = pos + 14; // pos1 = after "trace_ppe_hash" pos2 = line.find("(", pos1); if (pos2 == string::npos) { return(false); } ++pos2; @@ -162,7 +162,7 @@ bool chop_up_line(string& in_line, string& prefix, string& strings, string& salt // Get the prefix data dprintf(">chop_up_line(\"%s\",...)\n", line.c_str()); prefix = line.substr(0, pos); - line = line.substr(pos + TRACE_ADAL_HASH_LEN); + line = line.substr(pos + TRACE_PPE_HASH_LEN); dprintf(" prefix=\"%s\"\n", prefix.c_str()); // Get the strings and join/fix them: Store all strings between paired double-quotes up to the @@ -354,20 +354,20 @@ void parse_line(map<string,string>& rhash, string& line, string& out_line) size_t pos; out_line = ""; - // trace_adal_hash ( "..." ".." "..." , 2 ) - // regex: PREFIX 'trace_adal_hash' space '(' space STRINGS space ',' space NUMBER space ')' SUFFIX + // trace_ppe_hash ( "..." ".." "..." , 2 ) + // regex: PREFIX 'trace_ppe_hash' space '(' space STRINGS space ',' space NUMBER space ')' SUFFIX // STRINGS: '"' .* '"' space? + - //while($line =~ m/^(.*?)trace_adal_hash\s*\(\s*((".*?(?<!\\)"\s*)+),\s*(-?\d+)\s*\)(.*)$/) { + //while($line =~ m/^(.*?)trace_ppe_hash\s*\(\s*((".*?(?<!\\)"\s*)+),\s*(-?\d+)\s*\)(.*)$/) { // Attempt to approximate the above amazing perl regex... while( chop_up_line(line, prefix, strings, salt, suffix) ) { //dprintf("\n\nprefix = %s\nstrings = %s\nsalt = %s\nsuffix = %s\n", // prefix.c_str(), strings.c_str(), salt.c_str(), suffix.c_str()); - // is this a trace_adal_write_all call? - pos = prefix.find("trace_adal_write_all"); + // is this a trace_ppe_write_all call? + pos = prefix.find("trace_ppe_write_all"); if (pos != string::npos) { - // yes. replace trace_adal_hash with hash value and reduced format string + // yes. replace trace_ppe_hash with hash value and reduced format string format_salt = get_format_string(strings, format); // reduced format string will be added after hash value write_all_suffix = ",\" "; @@ -875,7 +875,7 @@ if (cmd_rc) if (!hashtab.empty()) { string stringfile = object; - stringfile += ".hash"; + stringfile += ".ppe.hash"; // open trace string file FILE* TRC = fopen(stringfile.c_str(), "w"); if (TRC == NULL) |