Community support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)

Can binary/symbol and sources search paths use top-level and go recursive?


When setting up the Binary/Symbol search and sources searches, can I use a top-level dir and expect the tool to go recursive?


There are a boatload of subdirs in my project and I don't want to specify every dir



0 Kudos
3 Replies

If I understand your requirement correctly, you can use a top directory for search-dir option (src/bin) option, all associated src/bin will be relocated in Inspector's result. See my example:

[root@snb01 tmp]# pwd

(Note that "/home/peter/tmp/tmp" is a top dir, there are "src" and "bin" sub-directories for storing source & binaries)

[root@snb01 tmp]# inspxe-cl -c mi3 -search-dir all:rp=/home/peter/tmp/tmp -- /home/peter/tmp/tmp/bin/test_memory
test leak
test uninitialized
test overlap memory copy
2 new problem(s) found
    1 Incorrect memcpy call problem(s) detected
    1 Memory leak problem(s) detected

[root@snb01 tmp]# inspxe-cl -R problems -verbose
P1: Error: Incorrect memcpy call: New
 P1.2: Error: Incorrect memcpy call: New
  /home/peter/tmp/tmp/src/test_memory.c(32): Error X2: Invalid memcpy arguments: Function overlap_copy: Module /home/peter/tmp/tmp/bin/test_memory
  Code snippet:
   30  int a[32];
  >32  memcpy(&a[0], &a[5], 8*sizeof(int));
   34  printf("test overlap memory copy\n");

  Stack (1 of 1 instance(s))
  >test_memory!overlap_copy - /home/peter/tmp/tmp/src/test_memory.c:32
   test_memory!main - /home/peter/tmp/tmp/src/test_memory.c:48!__libc_start_main - /lib64/
   test_memory!_start - /home/peter/tmp/tmp/bin/test_memory:0x4d4

P2: Error: Memory leak: New
 P2.4: Error: Memory leak: 256 Bytes: New
  /home/peter/tmp/tmp/src/test_memory.c(23): Error X4: Allocation site: Function memory_leak: Module /home/peter/tmp/tmp/bin/test_memory
  Code snippet:
   21  int memory_leak()
   22  {
  >23  char *s=malloc(256*sizeof(char));
   24  printf("test leak\n");
   25  return 1;

  Stack (1 of 1 instance(s))
  >test_memory!memory_leak - /home/peter/tmp/tmp/src/test_memory.c:23
   test_memory!main - /home/peter/tmp/tmp/src/test_memory.c:42!__libc_start_main - /lib64/
   test_memory!_start - /home/peter/tmp/tmp/bin/test_memory:0x4d4


You can see source info found, and contents were cached in Inspector's result.



0 Kudos

I know the command line interface allows recursive searches - my question or feature request is to allow this from the GUI.  I should be simple - add a 'Recursive' selection button next to each path a user enters into the Search Paths for BOTH Binary/Symbol dialog and for the Source dialog.

There is no reason for the GUI to not have something like this.  One should not have to use the command line, it is quite simple to implement this in the GUI - trivial programming for the GUI developers, I would guess they could complete this in 1 day or less.

Please enter a Feature Request for the 2016 product Updates, and for next year's major version.



0 Kudos

Hi Ron,

I verified in Inspector XE 2016, I can do similar thing on GUI -

1. I create a new project and select application - "/home/peter/tmp/tmp/bin/test_memory"

2. Use working directory "/tmp" - it should not be application path relevant.

3. Add "/home/peter/tmp" in "Binary/Symbol Search" tab

4. Add "/home/peter/tmp" in "Source Search" tab

(I have binary stored in "bin", source stored in "src" which are sub-directories of /home/peter/tmp/tmp)

I can run memory check, and no problem to open source of problem area. Would you please check this again?

Regards, Peter

0 Kudos