@@ -434,17 +434,17 @@ static EBPF_INLINE bool get_node_env_ptr(V8ProcInfo *proc, u64 *env_ptr_out)
434434 return true;
435435}
436436
437- static EBPF_INLINE bool get_node_async_id (V8ProcInfo * proc , u32 tid , u64 * out )
437+ static EBPF_INLINE bool get_node_async_id (V8ProcInfo * proc , u64 pid_tgid , u64 * out )
438438{
439439 int err ;
440440
441441 u64 env_ptr ;
442442 // Try to get fresh env_ptr
443443 if (get_node_env_ptr (proc , & env_ptr )) {
444- bpf_map_update_elem (& v8_cached_env_ptrs , & tid , & env_ptr , BPF_ANY );
444+ bpf_map_update_elem (& v8_cached_env_ptrs , & pid_tgid , & env_ptr , BPF_ANY );
445445 } else {
446446 // Fallback to cached value from previous successful extraction
447- u64 * cached_env_ptr = bpf_map_lookup_elem (& v8_cached_env_ptrs , & tid );
447+ u64 * cached_env_ptr = bpf_map_lookup_elem (& v8_cached_env_ptrs , & pid_tgid );
448448 if (cached_env_ptr && * cached_env_ptr != 0 ) {
449449 // TODO[btv] -- Figure out why the environment is sometimes null.
450450 // It doesn't seem to matter in practice, since the environment rarely (never?)
@@ -649,7 +649,8 @@ static EBPF_INLINE void maybe_add_node_custom_labels(PerCPURecord *record)
649649 }
650650
651651 u64 id ;
652- bool success = get_node_async_id (v8_proc , record -> trace .tid , & id );
652+ u64 pid_tgid = (u64 )record -> trace .pid << 32 | record -> trace .tid ;
653+ bool success = get_node_async_id (v8_proc , pid_tgid , & id );
653654 if (success ) {
654655 if (id == 0 ) {
655656 increment_metric (metricID_UnwindNodeClWarnIdZero );
0 commit comments