mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	perf report: Indicate JITed code better in report
Print [TID] tid %d instead of the crypted /tmp/perf-%d.map default.
% cat >loop.java
  public class loop {
          public static void main(String[] args)
          {
                  for (;;);
          }
  }
  ^D
  % javac loop.java
  % perf record java loop
  ^C
Before:
  % perf report --stdio
  ...
      56.09%  java     perf-34724.map      [.] 0x00007fd5bd021896
      19.12%  java     perf-34724.map      [.] 0x00007fd5bd021887
       9.79%  java     perf-34724.map      [.] 0x00007fd5bd021783
       8.97%  java     perf-34724.map      [.] 0x00007fd5bd02175b
After:
  % perf report --stdio
  ...
      56.09%  java     [JIT] tid 34724     [.] 0x00007fd5bd021896
      19.12%  java     [JIT] tid 34724     [.] 0x00007fd5bd021887
       9.79%  java     [JIT] tid 34724     [.] 0x00007fd5bd021783
       8.97%  java     [JIT] tid 34724     [.] 0x00007fd5bd02175b
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
LPU-Reference: 20190314225002.30108-7-andi@firstfloor.org
Link: https://lkml.kernel.org/n/tip-r17l6py9g0sezb7mi1f286gt@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									702fb9b415
								
							
						
					
					
						commit
						a4e7e6efab
					
				
					 1 changed files with 24 additions and 18 deletions
				
			
		|  | @ -1141,12 +1141,18 @@ void dso__set_short_name(struct dso *dso, const char *name, bool name_allocated) | |||
| 
 | ||||
| static void dso__set_basename(struct dso *dso) | ||||
| { | ||||
| 	char *base, *lname; | ||||
| 	int tid; | ||||
| 
 | ||||
| 	if (sscanf(dso->long_name, "/tmp/perf-%d.map", &tid) == 1) { | ||||
| 		if (asprintf(&base, "[JIT] tid %d", tid) < 0) | ||||
| 			return; | ||||
| 	} else { | ||||
| 	      /*
 | ||||
| 	       * basename() may modify path buffer, so we must pass | ||||
|                * a copy. | ||||
|                */ | ||||
|        char *base, *lname = strdup(dso->long_name); | ||||
| 
 | ||||
| 		lname = strdup(dso->long_name); | ||||
| 		if (!lname) | ||||
| 			return; | ||||
| 
 | ||||
|  | @ -1161,7 +1167,7 @@ static void dso__set_basename(struct dso *dso) | |||
| 
 | ||||
| 		if (!base) | ||||
| 			return; | ||||
| 
 | ||||
| 	} | ||||
| 	dso__set_short_name(dso, base, true); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Andi Kleen
						Andi Kleen