Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

allocs profiler: extend to record Types for all allocations - (fixUnknownType in allocations results) #43688

Labels
GCGarbage collectorfeatureIndicates new feature / enhancement requestsprofiler
@vilterp

Description

@vilterp

The allocation profiler in#42768 doesn't provideTypes for all allocations. There are two types of codepaths which allocations go through:

  1. generated code callingjl_gc_alloc_(jl_ptls_t ptls, size_t sz, void *ty) orjl_gc_alloc_string injulia_internal.h: these functions know thetype of the object being allocated.
    • which then (sometimes) callsjl_gc_pool_alloc /jl_gc_big_alloc
  2. generated code callingjl_gc_pool_alloc orjl_gc_big_alloc ingc.c directly: these functions donot know the type of the object being allocated.

The latter paths make it difficult to record the type of the allocation, since the type is not passed in — code is generated which calls it with just the size, and then sets the type later.

Another previous profiler PR,#33467, refactored the second codepath to take the type, and modifies the codegen to call the modified codepath, but hasn't been finished. For now, julia's Profile.Allocs functionality (introduced in#42768,#43868,#44043) doesn't do this.

Instead, for those types, we emit the type asProfile.Allocs.UnknownType in the allocations profile.

Experiments on a large codebase seem to show around ~40% of allocations have UnknownType, so the tool was still mostly useful. Still, getting the rest would be great!


Fixing this would require either passing the type of the allocation through to those functions by changing the codegen, or removing the instrumentation from those functions and instead emitting the instrumentation directly in the codegen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GCGarbage collectorfeatureIndicates new feature / enhancement requestsprofiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp