Skip to content

Instantly share code, notes, and snippets.

@jburgess777
Created October 13, 2018 15:01
Show Gist options
  • Save jburgess777/1d63705ebbb51db7c238374d52b74f30 to your computer and use it in GitHub Desktop.
Save jburgess777/1d63705ebbb51db7c238374d52b74f30 to your computer and use it in GitHub Desktop.
Launch pulseview with test file and then exit:
$ perf record ./pulseview test-file.sr
Display profile data:
$ perf report
e.g.
Before
Children Self Command Shared Object Symbol
+ 18.24% 18.24% pulseview pulseview [.] pv::data::LogicSegment::append_payload_to_mipmap ◆
+ 15.42% 15.42% pulseview libz.so.1.2.11 [.] crc32_z ▒
+ 13.31% 13.30% pulseview libz.so.1.2.11 [.] inffast.c ▒
+ 9.77% 9.76% pulseview libc-2.27.so [.] __memset_sse2_unaligned_erms ▒
+ 9.48% 9.48% pulseview libc-2.27.so [.] __memmove_sse2_unaligned_erms ▒
+ 9.48% 9.48% pulseview pulseview [.] pv::data::Segment::continue_raw_sample_iteration ▒
+ 8.73% 0.00% pulseview [unknown] [.] 0000000000000000 ▒
+ 3.09% 3.09% pulseview pulseview [.] pv::data::AnalogSegment::append_payload_to_envelope_levels ▒
+ 1.92% 1.92% pulseview pulseview [.] pv::data::AnalogSegment::append_interleaved_samples ▒
+ 1.34% 1.34% pulseview ld-2.27.so [.] do_lookup_x ▒
+ 1.10% 0.00% pulseview [unknown] [.] 0x0000000000a00015 ▒
+ 0.90% 0.00% pulseview [unknown] [.] 0x0000ffffffff0000
After PR#7 append_payload_to_mipmap has dropped from 18% to 10%:
https://github.com/sigrokproject/pulseview/pull/7
Overhead Command Shared Object Symbol
18.47% pulseview libz.so.1.2.11 [.] crc32_z
16.00% pulseview libz.so.1.2.11 [.] inffast.c
14.06% pulseview libc-2.27.so [.] __memmove_sse2_unaligned_erms
13.59% pulseview libc-2.27.so [.] __memset_sse2_unaligned_erms
10.04% pulseview pulseview [.] pv::data::LogicSegment::append_payload_to_mipmap
3.11% pulseview pulseview [.] pv::data::AnalogSegment::append_payload_to_envelope_levels
1.68% pulseview pulseview [.] pv::data::AnalogSegment::append_interleaved_samples
1.62% pulseview ld-2.27.so [.] do_lookup_x
0.82% pulseview libpython3.6m.so.1.0 [.] PyParser_AddToken
For a more detailed view:
$ perf record --call-graph=dwarf ./pulseview test-file.sr
$ perf report
Use "E" to exand all call chains
Before:
Children Self Command Shared Object Symbol
- 57.69% 0.01% pulseview libglib-2.0.so.0.5600.3 [.] g_main_context_dispatch
- 57.68% g_main_context_dispatch
- 53.60% fd_source_dispatch
- receive_data
- 53.60% stream_session_data
- 53.39% sr_session_send t
- 53.38% sigrok::DatafeedCallbackData::run
- 53.34% std::_Function_handler<void (std::shared_ptr<sigrok::Device>, std::shared_ptr<sigrok::Packet>), pv::Session::set_device(std::shared_ptr<pv::devices::Device>):
- 53.32% pv::Session::data_feed_in
- 41.03% pv::Session::feed_in_logic s
- 41.02% pv::data::LogicSegment::append_payload
- 30.51% pv::data::LogicSegment::append_payload_to_mipmap
10.24% pv::data::Segment::continue_raw_sample_iteration
- 1.77% pv::data::LogicSegment::reallocate_mipmap_level
- 1.76% realloc
- 1.64% _int_realloc
1.59% __memmove_sse2_unaligned_erms
- 10.20% pv::data::Segment::append_samples
6.67% __memset_sse2_unaligned_erms
3.45% __memmove_sse2_unaligned_erms
- 12.26% pv::Session::feed_in_analog
- 11.13% pv::data::AnalogSegment::append_interleaved_samples
- 4.76% pv::data::Segment::append_samples
3.17% __memset_sse2_unaligned_erms
1.54% __memmove_sse2_unaligned_erms
- 4.65% pv::data::AnalogSegment::append_payload_to_envelope_levels
- 1.71% pv::data::AnalogSegment::reallocate_envelope
- realloc
- 1.56% _int_realloc
1.56% __memmove_sse2_unaligned_erms
- 1.12% sigrok::Analog::get_data_as_float
- sr_analog_to_float
__memmove_sse2_unaligned_erms
After:
Children Self Command Shared Object Symbol
- 46.23% 0.01% pulseview libglib-2.0.so.0.5600.3 [.] g_main_context_dispatch
- 46.22% g_main_context_dispatch
- 41.80% fd_source_dispatch
- 41.78% receive_data
- 41.78% stream_session_data
- 41.55% sr_session_send i
- 41.53% sigrok::DatafeedCallbackData::run
- 41.51% std::_Function_handler<void (std::shared_ptr<sigrok::Device>, std::shared_ptr<sigrok::Packet>), pv::Session::set_device(std::shared_ptr<pv::devices::Device>):
- 41.49% pv::Session::data_feed_in
- 28.19% pv::Session::feed_in_logic
- 28.17% pv::data::LogicSegment::append_payload
- 14.84% pv::data::Segment::append_samples
10.10% __memset_sse2_unaligned_erms
4.60% __memmove_sse2_unaligned_erms i
- 13.02% pv::data::LogicSegment::append_payload_to_mipmap
- 2.94% pv::data::LogicSegment::reallocate_mipmap_level
- 2.92% realloc
- 2.77% _int_realloc
2.73% __memmove_sse2_unaligned_erms
- 13.27% pv::Session::feed_in_analog
- 11.62% pv::data::AnalogSegment::append_interleaved_samples
- 5.40% pv::data::Segment::append_samples
3.53% __memset_sse2_unaligned_erms
1.82% __memmove_sse2_unaligned_erms
- 4.21% pv::data::AnalogSegment::append_payload_to_envelope_levels
- 1.15% pv::data::AnalogSegment::reallocate_envelope
- realloc
- 1.14% _int_realloc
1.13% __memmove_sse2_unaligned_erms
- 1.64% sigrok::Analog::get_data_as_float
sr_analog_to_float
__memmove_sse2_unaligned_erms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment