--- zzzz-none-000/linux-3.10.107/tools/perf/util/pstack.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/tools/perf/util/pstack.c 2021-02-04 17:41:59.000000000 +0000 @@ -6,6 +6,7 @@ #include "util.h" #include "pstack.h" +#include "debug.h" #include #include @@ -73,3 +74,10 @@ pstack->entries[pstack->top] = NULL; return ret; } + +void *pstack__peek(struct pstack *pstack) +{ + if (pstack->top == 0) + return NULL; + return pstack->entries[pstack->top - 1]; +}