summaryrefslogtreecommitdiff
path: root/tools/perf/util/pstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/pstack.c')
-rw-r--r--tools/perf/util/pstack.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/pstack.c b/tools/perf/util/pstack.c
index a126e6cc6..b234a6e3d 100644
--- a/tools/perf/util/pstack.c
+++ b/tools/perf/util/pstack.c
@@ -74,3 +74,10 @@ void *pstack__pop(struct pstack *pstack)
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];
+}