Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loop-level instrumentation + more #32

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

jrmadsen
Copy link
Collaborator

  • fix loop-level instrumentation
  • support loop instrumentation w/o debug symbols via loop number
  • improve module_function messages
  • serialize num_basic_blocks
  • serialize num_outer_loops
  • serialize is_num_instructions_constrained
  • serialize is_loop_num_instructions_constrained
  • updated transpose example to use uniform_int_distribution
    • this resulted in a speedup of ~2x
    • instrumentation was slowed down significantly in binary rewrite due to instrumentation of uniform_int_distribution::operator() and thus tests using transpose exe use -E uniform_int_distribution
  • added transpose loop test
  • added fail regexes for tests which enable loop instrumentation
  • replace module->getName with module->getFullName in:
    • get_loop_file_line_info(...) in details.cpp
    • get_func_file_line_info(...) in details.cpp
    • get_basic_block_file_line_info(...) in details.cpp

Issue with loop-level instrumentation was due to _is_constrained lambda testing for _v == false after being passed _points == 0 instead of _v == true:

        auto _is_constrained = [this](bool _v, const std::string& _label) {
            if(!_v)
            {
                messages.emplace_back(3, "Skipping", "function", _label);
                return true;
            }
            return false;
        };


        size_t _points             = 0;
        size_t _ntraps             = 0;
        std::tie(_points, _ntraps) = query_instr(function, BPatch_entry, flow_graph, itr);

        if(_is_constrained(_points == 0, "no-instrumentable-loop-entry-point")) continue;

Effectively, since there _points was always > 0, this resulted in _is_constrained always returning true.

- fix loop-level instrumentation
- support loop instrumentation w/o debug symbols via loop number
- improve module_function messages
- serialize num_basic_blocks
- serialize num_outer_loops
- serialize is_num_instructions_constrained
- serialize is_loop_num_instructions_constrained
- updated transpose example to use uniform_int_distribution
- added transpose loop test
- added fail regexes for tests which enable loop instrumentation
- use module->getFullName in get_loop_file_line_info
- use module->getFullName in get_func_file_line_info
- use module->getFullName in get_basic_block_file_line_info
@jrmadsen jrmadsen added enhancement New feature or request bug fix Fixes a bug omnitrace-instrument Involves the omnitrace-instrument executable (binary instrumenter) binary instrumentation Binary instrumentation testing Extends/improves/modifies testing examples Adds new example or modifies existing example labels Jun 10, 2022
@jrmadsen jrmadsen merged commit a640fbd into ROCm:main Jun 10, 2022
@jrmadsen jrmadsen deleted the fix-loop-instrumentation branch June 10, 2022 11:57
jrmadsen added a commit to jrmadsen/omnitrace that referenced this pull request Jun 10, 2022
- fix loop-level instrumentation
- support loop instrumentation w/o debug symbols via loop number
- improve module_function messages
- serialize num_basic_blocks
- serialize num_outer_loops
- serialize is_num_instructions_constrained
- serialize is_loop_num_instructions_constrained
- updated transpose example to use uniform_int_distribution
- added transpose loop test
- added fail regexes for tests which enable loop instrumentation
- use module->getFullName in get_loop_file_line_info
- use module->getFullName in get_func_file_line_info
- use module->getFullName in get_basic_block_file_line_info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary instrumentation Binary instrumentation bug fix Fixes a bug enhancement New feature or request examples Adds new example or modifies existing example omnitrace-instrument Involves the omnitrace-instrument executable (binary instrumenter) testing Extends/improves/modifies testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loop instrumentation option does not appear to be instrumenting loops
1 participant