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

Add buffer debug names #132

Merged
merged 1 commit into from
Sep 20, 2022
Merged

Add buffer debug names #132

merged 1 commit into from
Sep 20, 2022

Conversation

facuMH
Copy link
Contributor

@facuMH facuMH commented Aug 3, 2022

For now this only shows the buffer names plus ids instead of just ids when printing the command graph, but in a future it could also be used for instrumenting with some tracer/profiler and facilitate getting a more relevant name than just the buffer id.

Also it is the first of hopefully more debug functionalities.

@facuMH facuMH requested review from psalz, PeterTh and fknorr August 3, 2022 12:31
@github-actions
Copy link

github-actions bot commented Aug 3, 2022

clang-tidy review says "All clean, LGTM! 👍"

include/debug.h Outdated Show resolved Hide resolved
src/graph_generator.cc Outdated Show resolved Hide resolved
test/buffer_manager_tests.cc Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Aug 4, 2022

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@fknorr fknorr left a comment

Choose a reason for hiding this comment

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

The tests have some variables that can be const. Also, mock_buffer has a method get_id, so we don't have to hard-code the expected buffer id.

Otherwise, LGTM!

test/graph_generation_tests.cc Outdated Show resolved Hide resolved
test/graph_generation_tests.cc Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Aug 5, 2022

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link

github-actions bot commented Sep 5, 2022

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 6, 2022

clang-tidy review says "All clean, LGTM! 👍"

@facuMH facuMH force-pushed the bufferNames branch 3 times, most recently from e58fd32 to 5f5a3a3 Compare September 7, 2022 09:28
@github-actions
Copy link

github-actions bot commented Sep 7, 2022

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

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

Thanks, I've added a few minor notes.

Also please update the commit message to properly explain what this is doing.

include/debug.h Outdated Show resolved Hide resolved
src/print_graph.cc Outdated Show resolved Hide resolved
src/print_graph.cc Outdated Show resolved Hide resolved
test/buffer_manager_tests.cc Outdated Show resolved Hide resolved
test/print_graph_tests.cc Show resolved Hide resolved
test/test_utils.h Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@fknorr fknorr left a comment

Choose a reason for hiding this comment

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

This looks good up to a few minor details!

One design decision that's tangentially related to this PR and that I don't like is the print_graph member functions on task_manager and command_graph. These classes shouldn't concern themselves with graph printing, instead, all of that functionality should all be concentrated in print_graph. Maybe this PR is a good opportunity to drive-by refactor this?

As far as I can see this would need a mechanism for iterating over the task buffer of a task manager, either through exposing the const task_ring_buffer& through a getter or by becoming friends with the TDAG printing function. Let's discuss this in person!

test/print_graph_tests.cc Outdated Show resolved Hide resolved
test/test_utils.h Outdated Show resolved Hide resolved
test/buffer_manager_tests.cc Outdated Show resolved Hide resolved
src/print_graph.cc Outdated Show resolved Hide resolved
src/print_graph.cc Outdated Show resolved Hide resolved
@psalz
Copy link
Member

psalz commented Sep 12, 2022

A thought I just had: Right now the debug names are only really helpful when printing the graph, not when debugging a program itself (e.g. with GDB). This is because the names are not stored in the buffers themselves, but somewhere deep inside the runtime. We could however store a pointer to a std::string inside the buffer, which is returned by the buffer manager upon registration. What do you think?

@facuMH facuMH force-pushed the bufferNames branch 3 times, most recently from d3ab85a to 25e10e8 Compare September 15, 2022 07:37
@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

This adds `[set|get]_buffer_name`, which should be more significant names than just the ids.
If set, these names are then included in the GraphViz output.
@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@facuMH facuMH changed the title Buffer Debug Names Add buffer debug names Sep 20, 2022
@facuMH facuMH merged commit 1076522 into master Sep 20, 2022
@facuMH facuMH deleted the bufferNames branch September 20, 2022 09:10
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.

4 participants