Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5073 Discussions

Intel VTune Profiler's "Application Output" Cannot Show Standard Error (stderr)

niconiconi
Novice
950 Views

I'm reporting a frustrating problem in Intel VTune Profiler - the Application Output window only shows standard output (stdout), not standard error (stderr). It can be reproduced by writing a C program like this:

 

#include <stdio.h>
int main(void)
{
    fprintf(stderr, "VTune cannot capture this message!\n");
    return 0;
}

 

The message never shows up in "Application Output", at least not in "Remote Linux (SSH)" mode.

This severely affects developer experience: Whenever VTune is used, one must modify and recompile the code to redirect stderr to stdout, otherwise some errors messages are never captured.

1 Solution
niconiconi
Novice
633 Views

I installed VTune on the remote server and started it in Web mode, using the following command:

~/intel/oneapi/vtune/2024.1/bin64/vtune-backend --web-port 8080 --enable-server-profiling

And yes, I can confirm that Web mode can correctly capture stderr messages.

Thanks for introducing me to VTune's Web mode. It's extremely useful for server development.

View solution in original post

0 Kudos
5 Replies
yuzhang3_intel
Moderator
906 Views

I am not sure I understand your question correctly. Below is my test result based on your sample code. You can see there is a message output when running the VTune command line remotely.

 

yuzhang3@yuzhang3-10710:~/workspace/test/print-err$ vtune -collect uarch-exploration -- ./test
vtune: Warning: To enable hardware event-based sampling, VTune Profiler has disabled the NMI watchdog timer. The watchdog timer will be re-enabled after collection completes.
vtune: Collection started. To stop the collection, either press CTRL-C or enter from another console window: vtune -r /home/yuzhang3/workspace/test/print-err/r001ue -command stop.
VTune cannot capture this message!
vtune: Collection stopped.
vtune: Using result path `/home/yuzhang3/workspace/test/print-err/r001ue'
vtune: Executing actions 19 % Resolving module symbols
vtune: Warning: Cannot locate file `vmlinux'.
vtune: Executing actions 19 % Resolving information for `vmlinux'
vtune: Warning: Cannot locate debugging information for the Linux kernel. Source-level analysis will not be possible. Function-level analysis will be limited to kernel symbol tables. See the Enabling Linux Kernel Analysis topic in the product online help for instructions.
vtune: Executing actions 75 % Generating a report Elapsed Time: 0.005s
| Application execution time is too short. Metrics data may be unreliable.
| Consider reducing the sampling interval or increasing your application
| execution time.
|

0 Kudos
niconiconi
Novice
893 Views

The problem is vtune-gui, not the command-line vtune - which is obiviously not affected (because any CLI program launched within a console prints directly to that console, so it's always displayed regardless of whether VTune can capture it).

To reproduce, first, enable the console logging:

  1. Launch vtune-gui
  2. Click the Setting icon at the bottom left
  3. Set Application Output Destination: Product Output Window
  4. Check Display Verbose Messages in the Collection Log Window

Then,

  1. Click Configure Analysis
  2. Select Where: Remote Linux (SSH)
  3. Select What: Enter Application Path
  4. Click Start

Now, during an analysis, the black console output window will be shown at the bottom of the screen at the bottom of the VTune window (see screenshot), If it doesn't show up, click the "four dots" icon to enable it. However, only stdout will be displayed, anything printed to stderr will not be displayed. I haven't tested if local applications have the same problem as I only profile remote applications, but I strongly suspect both are problematic.

 

Screenshot_2024-04-10_08-20-43.png

0 Kudos
yuzhang3_intel
Moderator
881 Views

Yes, I can reproduce the issue and investigate.

 

If you need stderr output, you can set up a web server following the steps below. This can support application output (stdout and stderr)

https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2024-1/install-web-server.html

yuzhang3_intel_0-1712737891736.png

VTune web server:

yuzhang3_intel_0-1712740501779.png

 

 

0 Kudos
yuzhang3_intel
Moderator
831 Views

Did you try with a web server, if it can work? Thanks.


0 Kudos
niconiconi
Novice
634 Views

I installed VTune on the remote server and started it in Web mode, using the following command:

~/intel/oneapi/vtune/2024.1/bin64/vtune-backend --web-port 8080 --enable-server-profiling

And yes, I can confirm that Web mode can correctly capture stderr messages.

Thanks for introducing me to VTune's Web mode. It's extremely useful for server development.

0 Kudos
Reply