Find the current process index: vlib_node_main_t *nm = &vm->node_main; current_process_index = nm->current_process_index;
Find the process object: vlib_process_t *p = vec_elt (nm->processes, current_process_index); Find the stack base: p->stack Take the address of a local variable in a function at what you think is the maximum stack depth, and subtract. That’s the instantaneous stack depth. You can sprinkle “stack_depth_now = p->stack - &foo; if (stack_depth_now > max_stack_depth) max = now” cookies in various places. HTH... From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of chetan bhasin Sent: Friday, March 24, 2023 9:24 AM To: vpp-dev <vpp-dev@lists.fd.io> Subject: Re: [vpp-dev] How to check stack size of process node Hi, Please share any thoughts on this. Thanks, On Sat, Mar 18, 2023, 13:18 chetan bhasin via lists.fd.io <http://lists.fd.io> <chetan.bhasin017=gmail....@lists.fd.io <mailto:gmail....@lists.fd.io> > wrote: Hi vpp-team, Could you please provide a way via which a process node stack size can be calculated. We are creating a process node, how to figure out the value of process_log2_n_stack_bytes?? Thanks,
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#22764): https://lists.fd.io/g/vpp-dev/message/22764 Mute This Topic: https://lists.fd.io/mt/97689882/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-