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

Allow to show the full-path of the functions #78

Open
portikCoder opened this issue Jan 31, 2022 · 1 comment
Open

Allow to show the full-path of the functions #78

portikCoder opened this issue Jan 31, 2022 · 1 comment

Comments

@portikCoder
Copy link

portikCoder commented Jan 31, 2022

Lots of cases are, when simple module names are not enough to be able to differentiate them.
A simple switch and if does the trick, as you already have this here: https://github.com/jrfonseca/gprof2dot/blob/master/gprof2dot.py#L2729 (at least in case of cProfile)
The only change would be that the module would not have been extracted, so the filename goes straight forward.
For eg.:

2698     def get_function_name(self, key):
2699         filename, line, name = key
new           if self._display_full_path:
new             return "%s:%d:%s" % (filename, line, name)
2700         module = os.path.splitext(filename)[0]
2701         module = os.path.basename(module)
2702         return "%s:%d:%s" % (module, line, name)

@jrfonseca
Copy link
Owner

Sounds good. Please post a PR that includes the above plus the command line switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants