GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing codebrowser.dev — backtracetest.c source code [linux/kernel/backtracetest.c] - Codebrowser

Codebrowser logo
About
Contact
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Simple stack backtrace regression test module
4 *
5 * (C) Copyright 2008 Intel Corporation
6 * Author: Arjan van de Ven <[email protected]>
7 */
8
9#include <linux/completion.h>
10#include <linux/delay.h>
11#include <linux/interrupt.h>
12#include <linux/module.h>
13#include <linux/sched.h>
14#include <linux/stacktrace.h>
15
16static void backtrace_test_normal(void)
17{
18 pr_info("Testing a backtrace from process context.\n");
19 pr_info("The following trace is a kernel self test and not a bug!\n");
20
21 dump_stack();
22}
23
24static void backtrace_test_bh_workfn(struct work_struct *work)
25{
26 dump_stack();
27}
28
29static DECLARE_WORK(backtrace_bh_work, &backtrace_test_bh_workfn);
30
31static void backtrace_test_bh(void)
32{
33 pr_info("Testing a backtrace from BH context.\n");
34 pr_info("The following trace is a kernel self test and not a bug!\n");
35
36 queue_work(wq: system_bh_wq, work: &backtrace_bh_work);
37 flush_work(work: &backtrace_bh_work);
38}
39
40#ifdef CONFIG_STACKTRACE
41static void backtrace_test_saved(void)
42{
43 unsigned long entries[8];
44 unsigned int nr_entries;
45
46 pr_info("Testing a saved backtrace.\n");
47 pr_info("The following trace is a kernel self test and not a bug!\n");
48
49 nr_entries = stack_trace_save(store: entries, ARRAY_SIZE(entries), skipnr: 0);
50 stack_trace_print(trace: entries, nr_entries, spaces: 0);
51}
52#else
53static void backtrace_test_saved(void)
54{
55 pr_info("Saved backtrace test skipped.\n");
56}
57#endif
58
59static int backtrace_regression_test(void)
60{
61 pr_info("====[ backtrace testing ]===========\n");
62
63 backtrace_test_normal();
64 backtrace_test_bh();
65 backtrace_test_saved();
66
67 pr_info("====[ end of backtrace testing ]====\n");
68 return 0;
69}
70
71static void exitf(void)
72{
73}
74
75module_init(backtrace_regression_test);
76module_exit(exitf);
77MODULE_DESCRIPTION("Simple stack backtrace regression test module");
78MODULE_LICENSE("GPL");
79MODULE_AUTHOR("Arjan van de Ven <[email protected]>");
80

source code of linux/kernel/backtracetest.c

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.