Skip to content

kGCTypeMinorMarkCompact mapping is missing on pref_hooks "kind" #48239

Open
@artur-ma

Description

Version

18

Platform

No response

Subsystem

pref_hooks

What steps will reproduce the bug?

Looks like GC operation with type "kGCTypeMinorMarkCompact" will never be observed
according to the v8 docs
https://v8docs.nodesource.com/node-18.2/d2/dc3/namespacev8.html#a83be2143eef5fa2b17127fd69686496b
there are 5 GCTypes

kGCTypeScavenge |  
kGCTypeMinorMarkCompact |  
kGCTypeMarkSweepCompact |  
kGCTypeIncrementalMarking |  
kGCTypeProcessWeakCallbacks |  
~~kGCTypeAll~~

But pref hooks is mapping only 4 of them

node/src/node_perf.h

Lines 63 to 68 in 191dce8

enum PerformanceGCKind {
NODE_PERFORMANCE_GC_MAJOR = v8::GCType::kGCTypeMarkSweepCompact,
NODE_PERFORMANCE_GC_MINOR = v8::GCType::kGCTypeScavenge,
NODE_PERFORMANCE_GC_INCREMENTAL = v8::GCType::kGCTypeIncrementalMarking,
NODE_PERFORMANCE_GC_WEAKCB = v8::GCType::kGCTypeProcessWeakCallbacks
};

same here

node/src/node_v8.cc

Lines 241 to 252 in 191dce8

static const char* GetGCTypeName(v8::GCType gc_type) {
switch (gc_type) {
case v8::GCType::kGCTypeScavenge:
return "Scavenge";
case v8::GCType::kGCTypeMarkSweepCompact:
return "MarkSweepCompact";
case v8::GCType::kGCTypeIncrementalMarking:
return "IncrementalMarking";
case v8::GCType::kGCTypeProcessWeakCallbacks:
return "ProcessWeakCallbacks";
default:
return "Unknown";

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

I would expect this type to be reported also
same as other third-party monitoring tools have

https://github.com/DataDog/dd-native-metrics-js/blob/main/src/metrics/GarbageCollection.hpp#L37

Additional information

No response

Activity

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

Metadata

Assignees

No one assigned

    Labels

    perf_hooksIssues and PRs related to the implementation of the Performance Timing API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions