File: test_stackdepot.py

package info (click to toggle)
drgn 0.0.33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,892 kB
  • sloc: python: 59,081; ansic: 51,400; awk: 423; makefile: 339; sh: 113
file content (23 lines) | stat: -rw-r--r-- 784 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (c) Meta Platforms, Inc. and affiliates.
# SPDX-License-Identifier: LGPL-2.1-or-later

import unittest

from drgn.helpers.linux.stackdepot import stack_depot_fetch
from tests.linux_kernel import skip_unless_have_test_kmod
from tests.linux_kernel.test_stack_trace import LinuxKernelStackTraceTestCase


@skip_unless_have_test_kmod
class TestStackDepot(LinuxKernelStackTraceTestCase):
    @classmethod
    def setUpClass(cls):
        super().setUpClass()
        if not cls.prog["drgn_test_have_stackdepot"]:
            raise unittest.SkipTest("kernel does not have stack depot")

    @skip_unless_have_test_kmod
    def test_stack_depot_fetch(self):
        self._test_drgn_test_kthread_trace(
            stack_depot_fetch(self.prog["drgn_test_stack_handle"])
        )