Skip to content

Commit 3801924

Browse files
committed
Clean up the diff
1 parent 6427b6e commit 3801924

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

Include/internal/pycore_interpframe_structs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ enum _frameowner {
2424
FRAME_OWNED_BY_GENERATOR = 1,
2525
FRAME_OWNED_BY_FRAME_OBJECT = 2,
2626
FRAME_OWNED_BY_INTERPRETER = 3,
27-
FRAME_OWNED_BY_CSTACK = 4, // XXX: Unused.
2827
};
2928

3029
struct _PyInterpreterFrame {

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_subprocess(script):
124124
server_socket.close()
125125
response = client_socket.recv(1024)
126126
if response != b"ready":
127-
raise RuntimeError(f"Unexpected response from subprocess: {response}")
127+
raise RuntimeError(f"Unexpected response from subprocess: {response!r}")
128128

129129
yield SubprocessInfo(proc, client_socket)
130130
finally:
@@ -1689,8 +1689,6 @@ class TestSampleProfilerIntegration(unittest.TestCase):
16891689
@classmethod
16901690
def setUpClass(cls):
16911691
cls.test_script = '''
1692-
import time
1693-
import os
16941692
import operator
16951693
import gc
16961694
@@ -1830,10 +1828,10 @@ def test_sampling_with_collapsed_export(self):
18301828
try:
18311829
profiling.sampling.sample.sample(
18321830
subproc.process.pid,
1833-
duration_sec=2, # XXX
1831+
duration_sec=1,
18341832
filename=collapsed_file.name,
18351833
output_format="collapsed",
1836-
sample_interval_usec=100, # XXX
1834+
sample_interval_usec=10000,
18371835
)
18381836
except PermissionError:
18391837
self.skipTest(
@@ -1848,8 +1846,6 @@ def test_sampling_with_collapsed_export(self):
18481846
with open(collapsed_file.name, "r") as f:
18491847
content = f.read()
18501848

1851-
with open("/Users/brandtbucher/cpython/x.txt", "w") as f: # XXX
1852-
f.write(content) # XXX
18531849
lines = content.strip().split("\n")
18541850
self.assertGreater(len(lines), 0)
18551851

Modules/_remote_debugging_module.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "Python.h"
2626
#include <internal/pycore_debug_offsets.h> // _Py_DebugOffsets
2727
#include <internal/pycore_frame.h> // FRAME_SUSPENDED_YIELD_FROM
28-
#include <internal/pycore_interpframe.h> // FRAME_OWNED_BY_CSTACK
28+
#include <internal/pycore_interpframe.h> // FRAME_OWNED_BY_INTERPRETER
2929
#include <internal/pycore_llist.h> // struct llist_node
3030
#include <internal/pycore_long.h> // _PyLong_GetZero
3131
#include <internal/pycore_stackref.h> // Py_TAG_BITS
@@ -2240,8 +2240,7 @@ is_frame_valid(
22402240

22412241
void* frame = (void*)frame_addr;
22422242

2243-
if (GET_MEMBER(char, frame, unwinder->debug_offsets.interpreter_frame.owner) == FRAME_OWNED_BY_CSTACK ||
2244-
GET_MEMBER(char, frame, unwinder->debug_offsets.interpreter_frame.owner) == FRAME_OWNED_BY_INTERPRETER) {
2243+
if (GET_MEMBER(char, frame, unwinder->debug_offsets.interpreter_frame.owner) == FRAME_OWNED_BY_INTERPRETER) {
22452244
return 0; // C frame
22462245
}
22472246

@@ -2461,8 +2460,8 @@ process_frame_chain(
24612460
uintptr_t initial_frame_addr,
24622461
StackChunkList *chunks,
24632462
PyObject *frame_info,
2464-
uintptr_t gc_frame
2465-
) {
2463+
uintptr_t gc_frame)
2464+
{
24662465
uintptr_t frame_addr = initial_frame_addr;
24672466
uintptr_t prev_frame_addr = 0;
24682467
const size_t MAX_FRAMES = 1024;

0 commit comments

Comments
 (0)