Skip to content

Tracing C function calls and keyword arguments #42142

Closed

Description

@fcieslok
mannequin
BPO 1229680
Nosy @mwhudson, @birkenfeld
Superseder
  • bpo-5330: profile and cProfile do not report C functions called with keyword arguments
  • Files
  • trace_call.c: Test case for tracing c function calls with keyword arguments
  • 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 2009-04-05.17:35:57.480>
    created_at = <Date 2005-06-29.13:00:31.000>
    labels = ['interpreter-core', 'type-feature']
    title = 'Tracing C function calls and keyword arguments'
    updated_at = <Date 2009-04-05.17:35:57.478>
    user = 'https://bugs.python.org/fcieslok'

    bugs.python.org fields:

    activity = <Date 2009-04-05.17:35:57.478>
    actor = 'georg.brandl'
    assignee = 'nbastin'
    closed = True
    closed_date = <Date 2009-04-05.17:35:57.480>
    closer = 'georg.brandl'
    components = ['Interpreter Core']
    creation = <Date 2005-06-29.13:00:31.000>
    creator = 'fcieslok'
    dependencies = []
    files = ['1731']
    hgrepos = []
    issue_num = 1229680
    keywords = []
    message_count = 4.0
    messages = ['25679', '25680', '25681', '85536']
    nosy_count = 4.0
    nosy_names = ['mwh', 'georg.brandl', 'nbastin', 'fcieslok']
    pr_nums = []
    priority = 'low'
    resolution = 'duplicate'
    stage = 'test needed'
    status = 'closed'
    superseder = '5330'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue1229680'
    versions = ['Python 2.7']

    Activity

    1. fcieslok commented on Jun 29, 2005

      fcieslokmannequin
      MannequinAuthor

      When a tracing/profiling function is registered via

      'PyEval_SetTrace()' or 'PyEval_SetProfile()',

      calling registered C functions should lead to calls of
      the tracing function with reason

      'PyTrace_C_CALL' and 'PyTrace_C_RETURN'.

      This does not work if the function call uses keyword
      arguments (test case attached) !

      The reason seems to be that in
      'Python/ceval.c:call_function ()' the macro 'C_TRACE'
      is used to wrap the calling of build-in functions into
      the corresponding calls of the tracing function. This
      does not apply if keyword arguments are used, in that
      case 'do_call ()' is called directly without being
      wrapped into that macro.

    2. mwhudson commented on Jun 29, 2005

      @mwhudson

      Logged In: YES
      user_id=6656

      I think this is the right assignment!

    3. nbastin commented on Jun 29, 2005

      nbastinmannequin
      Mannequin

      Logged In: YES
      user_id=430343

      Yep, I'll take a look into fixing this ASAP.

    4. birkenfeld commented on Apr 5, 2009

      @birkenfeld
      Member

      Setting bpo-5330 as a superseder, which also has a patch.

    5. transferred this issue fromon Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions