MCPcopy Index your code
hub / github.com/python/cpython / sections

Method sections

Lib/test/support/strace_helper.py:52–72  ·  view source on GitHub ↗

Find all "MARK " writes and use them to make groups of events. This is useful to avoid variable / overhead events, like those at interpreter startup or when opening a file so a test can verify just the small case under study.

(self)

Source from the content-addressed store, hash-verified

50 ]
51
52 def sections(self):
53 """Find all "MARK <X>" writes and use them to make groups of events.
54
55 This is useful to avoid variable / overhead events, like those at
56 interpreter startup or when opening a file so a test can verify just
57 the small case under study."""
58 current_section = "__startup"
59 sections = {current_section: []}
60 for event in self.events():
61 if event.syscall == 'write' and len(
62 event.args) > 2 and event.args[1].startswith("\"MARK "):
63 # Found a new section, don't include the write in the section
64 # but all events until next mark should be in that section
65 current_section = event.args[1].split(
66 " ", 1)[1].removesuffix('\\n"')
67 if current_section not in sections:
68 sections[current_section] = list()
69 else:
70 sections[current_section].append(event)
71
72 return sections
73
74def _filter_memory_call(call):
75 # mmap can operate on a fd or "MAP_ANONYMOUS" which gives a block of memory.

Callers 15

basic_testMethod · 0.45
test_case_sensitivityMethod · 0.45
test_query_errorsMethod · 0.45
test_clearMethod · 0.45
test_setitemMethod · 0.45
test_readingMethod · 0.45
test_cfgparser_dot_3Method · 0.45
test_no_first_sectionMethod · 0.45
test_no_sectionMethod · 0.45
test_multiple_configsMethod · 0.45
get_eventsFunction · 0.45
RemoveEmptySectionsMethod · 0.45

Calls 6

eventsMethod · 0.95
listClass · 0.85
startswithMethod · 0.45
removesuffixMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45

Tested by 15

basic_testMethod · 0.36
test_case_sensitivityMethod · 0.36
test_query_errorsMethod · 0.36
test_clearMethod · 0.36
test_setitemMethod · 0.36
test_readingMethod · 0.36
test_cfgparser_dot_3Method · 0.36
test_no_first_sectionMethod · 0.36
test_no_sectionMethod · 0.36
test_multiple_configsMethod · 0.36
test_load_nothingMethod · 0.36
test_set_optionMethod · 0.36