diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-01-26 11:16:16 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-01-27 00:02:03 -0600 |
commit | cc2a06c9d91f0a38a8774623efaa99a2406d3a17 (patch) | |
tree | ac468c2d694027a1ef771715d607ce6577cd42b6 | |
parent | 729d5f80bf53cacfbebe025c41cab7fe4d645a60 (diff) | |
download | talos-hostboot-cc2a06c9d91f0a38a8774623efaa99a2406d3a17.tar.gz talos-hostboot-cc2a06c9d91f0a38a8774623efaa99a2406d3a17.zip |
TracePP: Optional macro to add filename to trace.
Change-Id: Id0ba703e0f386a0d6021b870809cae01fd45b8c3
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/627
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
-rwxr-xr-x | src/build/trace/tracepp | 25 | ||||
-rw-r--r-- | src/include/usr/trace/interface.H | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/build/trace/tracepp b/src/build/trace/tracepp index 6922a4216..dfeda9d55 100755 --- a/src/build/trace/tracepp +++ b/src/build/trace/tracepp @@ -1,4 +1,26 @@ #!/usr/bin/perl -w +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/trace/tracepp $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2011 - 2012 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or other- +# wise divested of its trade secrets, irrespective of what has +# been deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END use strict; use File::Basename; @@ -79,6 +101,7 @@ print "realcpp is $realcpp\n" if $debug; my $opt; my ($source, $object, @ccopts, @cppopts); +my $source_basename; my $dodeps = 0; my $depfile; my @origargs = @ARGV; @@ -147,6 +170,7 @@ while(defined($opt = shift @ARGV)) { exit 1; } $source = $opt; + $source_basename = basename($source).": "; # put the - (for read-from-stdin) where the source file was # (order is important!) push @ccopts, "-"; @@ -341,6 +365,7 @@ sub parse_line($$) while($line =~ m/^(.*?)trace_adal_hash\s*\(\s*((".*?(?<!\\)"\s*)+),\s*(-?\d+)\s*\)(.*)$/) { ($prefix, $strings, $salt, $suffix) = ($1, $2, $4, $5); print "\n\nprefix = $prefix\nstrings = $strings\nsalt = $salt\nsuffix = $suffix\n" if $debug; + $strings =~ s/TRACEPP_INSERT_FILENAME/$source_basename/; $strings =~ s/^"//; $strings =~ s/"\s*$//; $strings =~ s/"\s*"//g; diff --git a/src/include/usr/trace/interface.H b/src/include/usr/trace/interface.H index 9e04c5afb..7b610931e 100644 --- a/src/include/usr/trace/interface.H +++ b/src/include/usr/trace/interface.H @@ -55,6 +55,8 @@ #define INFO_MRK "I>" #define ARG_MRK "A>" +#define TRACE_FILENAME "TRACEPP_INSERT_FILENAME" + const uint32_t TRACE_DEBUG = 1; //Indicates trace is debug const uint32_t TRACE_FIELD = 0; //Indicates trace is field |