@@ -427,13 +427,19 @@ static __inline int trace_io_event_common(void *ctx,
427427 v -> msg_type = MSG_COMMON ;
428428 bpf_get_current_comm (v -> comm , sizeof (v -> comm ));
429429#if !defined(LINUX_VER_KFUNC ) && !defined(LINUX_VER_5_2_PLUS )
430- struct tail_calls_context * context =
431- (struct tail_calls_context * )v -> data ;
430+ struct ctx_info_s * ctx_map = bpf_map_lookup_elem (& NAME (ctx_info ), & k0 );
431+ if (!ctx_map ) {
432+ __sync_fetch_and_add (& tracer_ctx -> push_buffer_refcnt , -1 );
433+ return -1 ;
434+ }
435+ struct tail_calls_context * context = & ctx_map -> tail_call ;
432436 context -> max_size_limit = data_max_sz ;
433437 context -> push_reassembly_bytes = 0 ;
434438 context -> vecs = false;
435439 context -> is_close = false;
436440 context -> dir = direction ;
441+ context -> sent_bytes = 0 ;
442+ context -> bytes_remaining = 0 ;
437443#ifdef SUPPORTS_KPROBE_ONLY
438444 bpf_tail_call (ctx , & NAME (progs_jmp_kp_map ), PROG_OUTPUT_DATA_KP_IDX );
439445#else
@@ -442,7 +448,7 @@ static __inline int trace_io_event_common(void *ctx,
442448 return 0 ;
443449#else
444450 return __output_data_common (ctx , tracer_ctx , v_buff , data_args ,
445- direction , false, data_max_sz , false, 0 );
451+ direction , false, data_max_sz , false, 0 , 0 );
446452#endif
447453}
448454
0 commit comments