Skip to content

Conversation

@lichao127
Copy link
Contributor

@lichao127 lichao127 commented Apr 17, 2025

This pull request adds a print of stderr if it exists during performance analysis. This improves the readability of the performance analysis output.

For example, without printing stderr, the output will look like this:

$ sudo -E python ./tools/analysis/profile.py --query 'SELECT * FROM system_info;'
Profiling query: SELECT * FROM system_info;
U:3  C:3  M:3  F:3  D:3  manual (1/1): utilization: -1 cpu_time: -1 memory: -1 fds: -1 duration: -1 

With stderr printing:

Profiling query: SELECT * FROM system_info;
Error: E0417 14:42:06.650187 3823731 virtual_table.cpp:1052] Exception while executing table system_info: Cannot get database value: host_uuid_v3
Query failed (1): Cannot get database value: host_uuid_v3
U:3  C:3  M:3  F:3  D:3  manual (1/1): utilization: -1 cpu_time: -1 memory: -1 fds: -1 duration: -1 

Osquery doc reference: https://osquery.readthedocs.io/en/stable/deployment/performance-safety/#understanding-the-output-from-profilepy
Related issue: #8538

@lichao127 lichao127 marked this pull request as ready for review April 17, 2025 22:59
@lichao127 lichao127 requested review from a team as code owners April 17, 2025 22:59
Copy link
Member

@zwass zwass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@zwass zwass merged commit 182672a into osquery:master Apr 18, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants