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

tools/profile: fix kernel delimiter when folding #2758

Merged
merged 2 commits into from
Feb 19, 2020

Conversation

graphaelli
Copy link
Contributor

When combining delmiiter and folding options: profile -d -f, this exception is thrown:

Traceback (most recent call last):
  File "./profile", line 337, in <module>
    line.extend(b["-"] if (need_delimiter and k.kernel_stack_id >= 0 and k.user_stack_id >= 0) else [])
  File "/usr/local/lib/python2.7/dist-packages/bcc/__init__.py", line 508, in __getitem__
    self.tables[key] = self.get_table(key)
  File "/usr/local/lib/python2.7/dist-packages/bcc/__init__.py", line 493, in get_table
    raise KeyError
KeyError

This change eliminates the delimiter when folding is enabled.

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song
Copy link
Collaborator

[buildbot, ok to test]

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@brendangregg
Copy link
Member

brendangregg commented Feb 18, 2020 via email

@graphaelli
Copy link
Contributor Author

@brendangregg That makes sense to me but I was trying to address the bug rather than introduce new functionality, happy to do it all at once here. How do you usually represent the delimiter in the flamegraph? Is the issue just that

line.extend(b["-"] if (need_delimiter and k.kernel_stack_id >= 0 and k.user_stack_id >= 0) else [])

should be b"[-]" ? That looks like:

image

@graphaelli graphaelli changed the title tools/profile: omit kernel delimiter when folding tools/profile: fix kernel delimiter when folding Feb 19, 2020
@graphaelli
Copy link
Contributor Author

pushed a commit reverting the original change with a fix that retains the delimiter

@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song yonghong-song merged commit 29aa619 into iovisor:master Feb 19, 2020
@graphaelli graphaelli deleted the fold-with-delimiter branch February 19, 2020 21:53
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
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.

None yet

3 participants