I am using pstack command in my c++ code and storing it in a string. The problem is it prints the stack upto last function and string becomes very heavy. Is there any way to print only last n lines of stack using pstack?
If it can't be done using pstack, then is there any other way to solve this purpose?
You can redirect pstack output to a file then you can use tail -n to see last n lines
e.g.