On 06/20/2012 02:20 AM, Paul Guo wrote:

On 06/19/2012 03:51 AM, Paul Guo wrote:
This is for the perf-events branch. To support the TILE platform,
a cpu type parsing function is needed, however I was not able to
successifully collect profiling data using operf. 

# operf --pid 3318
operf: Profiler started
operf: Press Ctl-c to stop profiling
JIT dump processing exited abnormally: 1

I looked into the code a bit but I was not able to quickly find
what caused this. In any case, the following parsing code has
been tested on our platform.
Paul,
I committed your patch.  In a separate commit, I made some minor changes to verbose output for operf.  Can you please do a 'git pull' and try using operf again, passing the "--verbose=debug" option.  This should give us some details on why you see the "JIT dump processing exited abnormally" error.  Thanks.
Here's the outpput when operf-ing a "top" command.

-sh-4.1# operf --pid 6325 --verbose=debug
Using samples dir /root/oprofile-build/oprofile_data/samples
operf: Profiler started
operf: Press Ctl-c to stop profiling
going into waitpid on operf record process 8207
Successfully read header info for sample data
Converting operf data to oprofile sample data format
sample type is 43
in op_sig_stop
in _handle_sigint
in _handle_sigint
Caught ctrl-C. Killing operf-record process . . .
Read 1 of sample data pipe returned with Interrupted system call
operf recording finished.
operf-record process returned OK
start time/end time is 1340176704/1340176705
JIT dump processing exited abnormally: 1
operf-read process returned OK

Use '--session-dir=/root/oprofile-build/oprofile_data'
with opreport and other post-processing tools to view your profile data.


Actually, it looks like operf ended OK, even though you got the "JIT dump processing exited 
abnormally" message.  Try 'opreport --session-dir=/root/oprofile-build/oprofile_data' to see
that profile data was collected.

That "JIT dump" message can occur if the /var/lib/oprofile/jitdump does not exit
on your system.  This is not a fatal error and should not cause JIT dump processing to end
abnormally, so I created a patch (below) to address that.  Can you test it out?

Thanks.
-Maynard

------------------------------------------------------------------------
 
diff -paurX ../diff_fileExclusionFilter ../workspace/oprofile-upstream/opjitconv/opjitconv.c oprofile/opjitconv/opjitconv.c
--- ../workspace/oprofile-upstream/opjitconv/opjitconv.c	2012-06-11 09:41:05.068788186 -0500
+++ oprofile/opjitconv/opjitconv.c	2012-06-20 09:35:45.224282953 -0500
@@ -577,10 +577,25 @@ static int op_process_jit_dumpfiles(char
 	}
 
 
+	errno = 0;
 	if ((rc = get_matching_pathnames(&jd_fnames, get_pathname,
 		jitdump_dir, "*.dump", NO_RECURSION)) < 0
-			|| list_empty(&jd_fnames))
+			|| list_empty(&jd_fnames)) {
+		if (errno) {
+			if (errno != ENOENT) {
+				char msg[PATH_MAX];
+				strcpy(msg, "opjitconv: fatal error trying to find JIT dump files in ");
+				strcat(msg, jitdump_dir);
+				perror(msg);
+				rc = OP_JIT_CONV_FAIL;
+			} else {
+				verbprintf(debug, "opjitconv: Non-fatal error trying to find JIT dump files in %s: %s\n",
+				           jitdump_dir, strerror(errno));
+				rc = OP_JIT_CONV_NO_DUMPFILE;
+			}
+		}
 		goto rm_tmp;
+	}
 
 	if (delete_jitdumps)
 		_add_jitdumps_to_deletion_list(&jd_fnames, jitdump_dir);

[snip]