-1

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?

Mike
  • 47,263
  • 29
  • 113
  • 177
Dharmendra
  • 384
  • 1
  • 5
  • 22

1 Answers1

0

You can redirect pstack output to a file then you can use tail -n to see last n lines

e.g.

pstack 243 > File.txt
tail -10 File.txt
anshul garg
  • 473
  • 3
  • 7