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

Display module names of C functions in cProfile #66062

Closed
pitrou opened this issue Jun 24, 2014 · 4 comments
Closed

Display module names of C functions in cProfile #66062

pitrou opened this issue Jun 24, 2014 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@pitrou
Copy link
Member

pitrou commented Jun 24, 2014

BPO 21863
Nosy @birkenfeld, @ncoghlan, @pitrou, @vstinner
Files
  • cprofile_names.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-06-28.03:56:44.250>
    created_at = <Date 2014-06-24.20:23:44.529>
    labels = ['type-feature', 'library']
    title = 'Display module names of C functions in cProfile'
    updated_at = <Date 2014-06-28.03:56:44.250>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2014-06-28.03:56:44.250>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-06-28.03:56:44.250>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2014-06-24.20:23:44.529>
    creator = 'pitrou'
    dependencies = []
    files = ['35774']
    hgrepos = []
    issue_num = 21863
    keywords = ['patch']
    message_count = 4.0
    messages = ['221493', '221653', '221771', '221772']
    nosy_count = 5.0
    nosy_names = ['georg.brandl', 'ncoghlan', 'pitrou', 'vstinner', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21863'
    versions = ['Python 3.5']

    @pitrou
    Copy link
    Member Author

    pitrou commented Jun 24, 2014

    Currently, cProfile output displays "built-in functions" (i.e. module functions implemented in C, such as hasattr()) using only their names. This is not very useful when those functions may be provided by any third-party library. Attached patch adds the module name (as provided by __module__) to the output.

    @pitrou pitrou added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jun 24, 2014
    @vstinner
    Copy link
    Member

    The patch looks good to me. I didn't test it, but I see that the change is already tested by existing tests.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 28, 2014

    New changeset 6dd4c2d30b0e by Antoine Pitrou in branch 'default':
    Issue bpo-21863: cProfile now displays the module name of C extension functions, in addition to their own name.
    http://hg.python.org/cpython/rev/6dd4c2d30b0e

    @pitrou
    Copy link
    Member Author

    pitrou commented Jun 28, 2014

    Thank you, committed!

    @pitrou pitrou closed this as completed Jun 28, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants