Coverage for procpath/proctree.py: 99%

147 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2025-04-05 18:56 +0000

1import collections 

2import functools 

3import json 

4import logging 

5import os 

6import sys 

7from typing import Dict, List, Literal, Optional, Type 

8 

9import jsonpyth 

10 

11from .procfile import ProcfileType 

12 

13 

14__all__ = 'Forest', 'JsonPathQueryError', 'flatten', 'query' 

15 

16logger = logging.getLogger(__package__) 

17 

18 

19class AttrDict(dict): 

20 """ 

21 Attribute key access dictionary. 

22 

23 It is used for ``jsonpyth`` filter expressions which operate over 

24 dictionaries and would need subscription otherwise. 

25 """ 

26 

27 def __init__(self, *args, **kwargs): 

28 super().__init__(*args, **kwargs) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctree.test_attr_dictprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

29 self.__dict__ = self (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctree.test_attr_dictprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

30 

31 

32class TreeError(Exception): 

33 """Generic process tree error.""" 

34 

35 

36class JsonPathQueryError(TreeError): 

37 """JSON Path query error.""" 

38 

39 

40class Forest: 

41 """ 

42 Procfs object forest builder. 

43 

44 :argument procfile_registry: 

45 A number of procfiles to build the forest from. 

46 :argument procfs: 

47 The mount of Procfs (which can be different from ``/proc``). 

48 :argument procfs_target: 

49 The type of objects to read from Procfs. 

50 :argument skip_self: 

51 Whether to skip the PID of the containing process. 

52 :argument dictcls: 

53 The representation of a Procfs object. 

54 """ 

55 

56 _procfile_registry: List[Dict[str, ProcfileType]] 

57 """ 

58 2-pass registry of profiles. 

59 

60 Elements are dictionaries mapping names to procfile callables. 

61 """ 

62 

63 _skip_self: bool 

64 _dictcls: type 

65 _procfs: str 

66 _procfs_target: Literal['process', 'thread'] 

67 

68 _procfs_target_tpl: str 

69 """ 

70 Procfs target file path template. 

71 

72 Process and thread identifiers live in the same namespace (and 

73 overlap for the main thread), ``/proc/{id}``, and have the same 

74 structure and set of Procfs files (but not content!). Only 

75 processes are visible, say to ``ls /proc``, but threads can be read 

76 by direct path previously listed from ``/proc/{tgid}/task/{pid}``. 

77 To read aggregate (process) and individual task (thread) metrics 

78 different paths are used, correspondingly: 

79 

80 1. ``/proc/{pid}/{name}`` 

81 2. ``/proc/{pid}/task/{pid}/{name}`` 

82 

83 In the latter case thread-level files are accessed through 

84 top-level entry of the thread (with the same content as its 

85 process' directory) to avoid the need to carry ``tgid`` around. 

86 """ 

87 

88 def __init__( 

89 self, 

90 procfile_registry: Dict[str, ProcfileType], 

91 procfs: str = '/proc', 

92 procfs_target: str = 'process', 

93 skip_self: bool = True, 

94 dictcls: Type[dict] = AttrDict, 

95 ): 

96 if 'stat' not in procfile_registry: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_invalid_dunder_init_argumentsprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

97 raise TreeError('stat file reader is required') procpath.test.unit.TestProctreeForest.test_invalid_dunder_init_arguments

98 elif procfs_target not in ('process', 'thread'): (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_invalid_dunder_init_argumentsprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

99 raise TreeError('Procfs target must be process or thread') procpath.test.unit.TestProctreeForest.test_invalid_dunder_init_arguments

100 

101 registry = procfile_registry.copy() (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

102 self._procfile_registry = [{'stat': registry.pop('stat')}, registry] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

103 

104 is_local_procfs = procfs == '/proc' # kind of, but a good enough start (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

105 self._skip_self = skip_self and is_local_procfs (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

106 

107 self._procfs = procfs (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

108 self._procfs_target = procfs_target # type: ignore[annotation-type-mismatch] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

109 if procfs_target == 'process': (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

110 self._procfs_target_tpl = '{procfs}/{pid}/{name}' (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

111 else: 

112 self._procfs_target_tpl = '{procfs}/{pid}/task/{pid}/{name}' procpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

113 

114 self._dictcls = dictcls (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_targetprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_selfprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

115 

116 def _get_pid_list(self) -> List[int]: 

117 all_pids = [int(p) for p in os.listdir(self._procfs) if p.isdigit()] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

118 if self._procfs_target == 'thread': (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

119 all_task_pids = [] procpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

120 for p in all_pids: procpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

121 try: procpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

122 all_task_pids.extend([int(p) for p in os.listdir(f'{self._procfs}/{p}/task')]) procpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

123 except FileNotFoundError: 

124 pass # race condition 

125 else: 

126 all_pids = sorted(all_task_pids) procpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

127 

128 if self._skip_self: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

129 try: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

130 all_pids.remove(os.getpid()) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

131 except ValueError: procpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warning

132 logger.warning('Procpath process PID was not found in collected PIDs') procpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warning

133 

134 return all_pids (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_pid_listprocpath.test.unit.TestProctreeForest.test_get_pid_list_missing_own_pid_warningprocpath.test.unit.TestProctreeForest.test_get_pid_list_thread_target

135 

136 def _read_process_dict(self, pid, pass_n, *, raise_on_missing_file=True): 

137 result = self._dictcls() (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

138 for name, pfile in self._procfile_registry[pass_n].items(): (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

139 procfs_path = self._procfs_target_tpl.format(procfs=self._procfs, pid=pid, name=name) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

140 try: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

141 result[name] = pfile.reader(procfs_path, dictcls=self._dictcls) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

142 except ( procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

143 # Permission 

144 PermissionError, 

145 # Race condition 

146 FileNotFoundError, ProcessLookupError, 

147 # Partial and/or corrupted 

148 ValueError, TypeError, 

149 ) as ex: 

150 # Permission errors reported as warnings because they 

151 # typically mean insufficient privilege what the user 

152 # may want to raise. Missing file errors mean that it's 

153 # either a race condition on first pass read which is 

154 # re-raised, or on second pass where it's reported for 

155 # debugging message because the user can do nothing. 

156 # 

157 # Note that ProcessLookupError can be raise from read() 

158 # of a procfs file of a process that has just gone. On 

159 # open() FileNotFoundError is raised in the same case. 

160 # 

161 # ValueError may be cause by a partially available/read 

162 # procfs file (seen on "io" on 3.10 Kernel). TypeError 

163 # has not been seen but hypothetically can happen in a 

164 # similar case. 

165 level = logging.WARNING procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

166 if isinstance(ex, (FileNotFoundError, ProcessLookupError)): procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

167 if raise_on_missing_file: procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_error

168 raise procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_pty

169 else: 

170 level = logging.DEBUG procpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_error

171 

172 msg = 'Storing empty values for pid %d, procfile %s because of %s' procpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

173 logger.log(level, msg, pid, name, ex) procpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

174 result[name] = ( procpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

175 self._dictcls(pfile.empty) if isinstance(pfile.empty, dict) else pfile.empty 

176 ) 

177 

178 return result (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_read_process_dictprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_ioprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_smaps_rollupprocpath.test.unit.TestProctreeForest.test_read_process_dict_corrupted_statusprocpath.test.unit.TestProctreeForest.test_read_process_dict_file_not_found_errorprocpath.test.unit.TestProctreeForest.test_read_process_dict_permission_error

179 

180 def _strip_branches(self, nodemap: dict, branch_pids: list) -> dict: 

181 # Stack of roots of target branches 

182 nodes = [nodemap[p] for p in branch_pids if p in nodemap] procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

183 

184 # Collect nodes that connect the branches to the root 

185 result = {} procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

186 path_to_root_children_map = collections.defaultdict(set) procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

187 for node in nodes: procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

188 while node['stat']['ppid'] in nodemap: procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

189 ppid = node['stat']['ppid'] procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

190 if ppid not in result: procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

191 result[ppid] = self._dictcls(nodemap[ppid], children=[]) procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

192 parent = result[ppid] procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

193 

194 pid = node['stat']['pid'] procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

195 if pid not in path_to_root_children_map[ppid]: procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

196 parent['children'].append(node) procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

197 path_to_root_children_map[ppid].add(pid) procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

198 

199 node = parent procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids

200 

201 # Collect the branches' descendants 

202 while nodes: procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

203 node = nodes.pop() procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

204 result[node['stat']['pid']] = node procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

205 nodes.extend(node.get('children', [])) procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

206 

207 return result procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

208 

209 def _get_nodemap(self, branch_pids: Optional[list] = None) -> dict: 

210 """ 

211 Fetch forest expansion dictionary. 

212 

213 The structure looks like this:: 

214 

215 [ 

216 {'stat': {'pid': 1, 'ppid': 0, ...}, 'children': [ 

217 {'stat': {'pid': 2, 'ppid': 1, ...}}, 

218 {'stat': {'pid': 3, 'ppid': 1, ...}}, 

219 ... 

220 ]}, 

221 {'stat': {'pid': 2, 'ppid': 1, ...}}, 

222 {'stat': {'pid': 3, 'ppid': 1, ...}}, 

223 ... 

224 ] 

225 

226 It allows building a forest in two passes utilising the property 

227 of dictionaries for the same PID being the same instance. 

228 

229 Optional branch PID list allows to strip other branches in the 

230 forest. Given branches are still connected to the root to require 

231 no change to the JSONPath queries. 

232 

233 Process procfile collection works in 2 passes. On the first pass 

234 only ``stat``` is read to build the forest structure. On the 

235 second pass the rest is read. When combined with a branch 

236 filter it allows to avoid many unnecessary file operations and 

237 parsing (especially for human-readable ``status``). 

238 

239 Before first pass all PIDs are read from ``/proc``. In case of 

240 race condition a procfile may disappear right before the first 

241 pass. In that case the PID is ignored. If PID is missing on the 

242 second pass, it's filled with empty values. 

243 """ 

244 

245 all_pids = self._get_pid_list() (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

246 result = {} (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

247 for pid in all_pids.copy(): (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

248 try: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

249 result[pid] = self._read_process_dict(pid, pass_n=0) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

250 except (FileNotFoundError, ProcessLookupError): procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_pty

251 all_pids.remove(pid) # race condition procpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_pty

252 

253 for pid in all_pids: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

254 node = result[pid] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

255 ppid = node['stat']['ppid'] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

256 if ppid in result: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

257 result[ppid].setdefault('children', []).append(node) # type: ignore (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

258 

259 if branch_pids: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

260 result = self._strip_branches(result, branch_pids) procpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noop

261 

262 for pid, node in result.items(): (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

263 node.update(self._read_process_dict(pid, pass_n=1, raise_on_missing_file=False)) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

264 

265 return result (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_nodemapprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

266 

267 def get_roots(self, branch_pids: Optional[list] = None) -> list: 

268 """ 

269 Get root nodes, containing its descendants, of the process forest. 

270 

271 If optional branch PID list is provided, other branches are 

272 stripped from the result. 

273 """ 

274 

275 nodemap = self._get_nodemap(branch_pids) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

276 return [n for n in nodemap.values() if n['stat']['ppid'] not in nodemap] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_no_query_root_outputprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_environmentprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_queryprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_by_sigtermprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_errorprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_repeat_endprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigintprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_firstprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_killprocpath.test.cmd.TestWatchCommand.test_watch_tree_cleanup_on_sigint_shell_first_ptyprocpath.test.cmd.TestWatchCommand.test_watch_verbatim_commandsprocpath.test.unit.TestProcfile.test_read_fdprocpath.test.unit.TestProctreeForest.test_get_rootsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pidsprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_hidden_parentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_non_existentprocpath.test.unit.TestProctreeForest.test_get_roots_branch_pids_noopprocpath.test.unit.TestProctreeForest.test_get_roots_do_not_skip_self

277 

278 

279def query(roots: List[dict], jsonpath: str) -> list: 

280 """ 

281 Execute JSONPath query on given root notes. 

282 

283 :raises JsonPathQueryError: 

284 Indicated query error. 

285 """ 

286 

287 try: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fd

288 result = jsonpyth.jsonpath({'children': roots}, jsonpath, always_return_list=True) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fd

289 except jsonpyth.JsonPathSyntaxError as ex: (empty)procpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_query_error

290 raise JsonPathQueryError(str(ex)) from ex (empty)procpath.test.cmd.TestQueryCommand.test_query_jsonpath_syntax_errorprocpath.test.cmd.TestRecordCommand.test_record_syntax_errorprocpath.test.cmd.TestWatchCommand.test_watch_query_error

291 else: 

292 return result (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestQueryCommand.test_query_delimitedprocpath.test.cmd.TestQueryCommand.test_query_no_new_line_on_empty_outputprocpath.test.cmd.TestQueryCommand.test_query_query_node_list_json_outputprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.cmd.TestWatchCommand.test_watch_empty_env_command_resultprocpath.test.cmd.TestWatchCommand.test_watch_empty_query_resultprocpath.test.cmd.TestWatchCommand.test_watch_no_restartprocpath.test.cmd.TestWatchCommand.test_watch_no_restart_no_reevalprocpath.test.cmd.TestWatchCommand.test_watch_process_pids_exposedprocpath.test.cmd.TestWatchCommand.test_watch_query_errorprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_loggingprocpath.test.cmd.TestWatchCommand.test_watch_std_stream_write_after_stopprocpath.test.unit.TestProcfile.test_read_fd

293 

294 

295def _flatten_hierarchy(node_list, _pid_seen=None) -> List[dict]: 

296 """ 

297 Turn forest node list recursively into a flat list. 

298 

299 ``node_list`` can contain repeat subtrees from JSON Path recursive 

300 search, which are de-duplicated (first node occurrence wins). 

301 """ 

302 

303 result = [] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

304 _pid_seen = _pid_seen or set() (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

305 for node in node_list: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

306 pid = node['stat']['pid'] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

307 if pid not in _pid_seen: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

308 _pid_seen.add(pid) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

309 result.append(node) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

310 result.extend(_flatten_hierarchy(node.get('children', []), _pid_seen)) (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

311 

312 return result (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

313 

314@functools.lru_cache(maxsize=32) 

315def _flatten_vector(v) -> str: 

316 """Serialise a non-scalar value.""" 

317 

318 return json.dumps(v, separators=(',', ':')) procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.unit.TestProctree.test_flatten_list_value

319 

320def _flatten_value(v): 

321 """Turn list values into their JSON string representation.""" 

322 

323 return _flatten_vector(v) if isinstance(v, tuple) else v (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

324 

325def _flatten_file_keys(node: dict, procfile_list): 

326 """Make flat dictionary out of proc file nested dictionary.""" 

327 

328 result = {} (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

329 for procfile_name, value in node.items(): (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

330 if procfile_name not in procfile_list: (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

331 continue (empty)procpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

332 

333 if isinstance(value, dict): (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

334 result.update({ (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

335 sys.intern(f'{procfile_name}_{k}'): _flatten_value(v) 

336 for k, v in value.items() 

337 }) 

338 else: 

339 result[procfile_name] = value (empty)procpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

340 

341 return result (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

342 

343def flatten(node_list, procfile_list): 

344 """ 

345 Make a PID → flat mapping out of node list. 

346 

347 Only keys occurring in ``procfile_list`` are taken into result. 

348 """ 

349 

350 result = [_flatten_file_keys(n, procfile_list) for n in _flatten_hierarchy(node_list)] (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption

351 return result (empty)procpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestQueryCommand.test_query_only_sqlprocpath.test.cmd.TestQueryCommand.test_query_sql_syntax_errorprocpath.test.cmd.TestQueryCommand.test_query_thread_targetprocpath.test.cmd.TestQueryCommand.test_query_with_envrionmentprocpath.test.cmd.TestQueryCommand.test_query_with_sqlprocpath.test.cmd.TestRecordCommand.test_record_allprocpath.test.cmd.TestRecordCommand.test_record_environmentprocpath.test.cmd.TestRecordCommand.test_record_environment_database_fileprocpath.test.cmd.TestRecordCommand.test_record_n_timesprocpath.test.cmd.TestRecordCommand.test_record_pid_listprocpath.test.cmd.TestRecordCommand.test_record_pid_list_onlyprocpath.test.cmd.TestRecordCommand.test_record_queryprocpath.test.unit.TestProcrecSqliteStorage.test_recordprocpath.test.unit.TestProcrecSqliteStorage.test_record_unsigned_bigintprocpath.test.unit.TestProcret.test_rss_filter_pid_short_and_longprocpath.test.unit.TestProctree.test_flattenprocpath.test.unit.TestProctree.test_flatten_list_valueprocpath.test.unit.TestProctree.test_flatten_single_value_procfileprocpath.test.unit.TestSqlitevizQuery.test_total_cpu_usageprocpath.test.unit.TestSqlitevizQuery.test_total_memory_consumption