|
@@ -2891,6 +2891,21 @@ static int proc_pid_patch_state(struct seq_file *m, struct pid_namespace *ns,
|
|
}
|
|
}
|
|
#endif /* CONFIG_LIVEPATCH */
|
|
#endif /* CONFIG_LIVEPATCH */
|
|
|
|
|
|
|
|
+#ifdef CONFIG_STACKLEAK_METRICS
|
|
|
|
+static int proc_stack_depth(struct seq_file *m, struct pid_namespace *ns,
|
|
|
|
+ struct pid *pid, struct task_struct *task)
|
|
|
|
+{
|
|
|
|
+ unsigned long prev_depth = THREAD_SIZE -
|
|
|
|
+ (task->prev_lowest_stack & (THREAD_SIZE - 1));
|
|
|
|
+ unsigned long depth = THREAD_SIZE -
|
|
|
|
+ (task->lowest_stack & (THREAD_SIZE - 1));
|
|
|
|
+
|
|
|
|
+ seq_printf(m, "previous stack depth: %lu\nstack depth: %lu\n",
|
|
|
|
+ prev_depth, depth);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+#endif /* CONFIG_STACKLEAK_METRICS */
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Thread groups
|
|
* Thread groups
|
|
*/
|
|
*/
|
|
@@ -2992,6 +3007,9 @@ static const struct pid_entry tgid_base_stuff[] = {
|
|
#ifdef CONFIG_LIVEPATCH
|
|
#ifdef CONFIG_LIVEPATCH
|
|
ONE("patch_state", S_IRUSR, proc_pid_patch_state),
|
|
ONE("patch_state", S_IRUSR, proc_pid_patch_state),
|
|
#endif
|
|
#endif
|
|
|
|
+#ifdef CONFIG_STACKLEAK_METRICS
|
|
|
|
+ ONE("stack_depth", S_IRUGO, proc_stack_depth),
|
|
|
|
+#endif
|
|
};
|
|
};
|
|
|
|
|
|
static int proc_tgid_base_readdir(struct file *file, struct dir_context *ctx)
|
|
static int proc_tgid_base_readdir(struct file *file, struct dir_context *ctx)
|