• Home
  • Raw
  • Download

Lines Matching refs:self

76     def thread_comm(self) -> str:  argument
77 return _char_pt_to_str(self._thread_comm)
80 def in_kernel(self) -> bool: argument
81 return bool(self._in_kernel)
103 def name(self) -> str: argument
104 return _char_pt_to_str(self._name)
106 def parse_value(self, data: ct.c_char_p) -> Union[str, bytes, List[bytes]]: argument
112 if self.is_dynamic:
113 offset, max_len = struct.unpack('<HH', data[self.offset:self.offset + 4])
119 if self.elem_count > 1 and self.elem_size == 1:
123 while length < self.elem_count and bytes_to_str(data[self.offset + length]) != '\x00':
125 return bytes_to_str(data[self.offset: self.offset + length])
126 unpack_key = self._unpack_key_dict.get(self.elem_size)
128 if not self.is_signed:
130 value = struct.unpack('%d%s' % (self.elem_count, unpack_key),
131 data[self.offset:self.offset + self.elem_count * self.elem_size])
135 offset = self.offset
136 for _ in range(self.elem_count):
137 value.append(data[offset: offset + self.elem_size])
138 offset += self.elem_size
139 if self.elem_count == 1:
165 def name(self) -> str: argument
166 return _char_pt_to_str(self._name)
197 def dso_name(self) -> str: argument
198 return _char_pt_to_str(self._dso_name)
201 def symbol_name(self) -> str: argument
202 return _char_pt_to_str(self._symbol_name)
243 def __init__(self, native_lib_path: Optional[str] = None): argument
245 native_lib_path = self._get_native_lib()
247 self._load_dependent_lib()
248 self._lib = ct.CDLL(native_lib_path)
249 self._CreateReportLibFunc = self._lib.CreateReportLib
250 self._CreateReportLibFunc.restype = ct.POINTER(ReportLibStructure)
251 self._DestroyReportLibFunc = self._lib.DestroyReportLib
252 self._SetLogSeverityFunc = self._lib.SetLogSeverity
253 self._SetSymfsFunc = self._lib.SetSymfs
254 self._SetRecordFileFunc = self._lib.SetRecordFile
255 self._SetKallsymsFileFunc = self._lib.SetKallsymsFile
256 self._ShowIpForUnknownSymbolFunc = self._lib.ShowIpForUnknownSymbol
257 self._ShowArtFramesFunc = self._lib.ShowArtFrames
258 self._MergeJavaMethodsFunc = self._lib.MergeJavaMethods
259 self._AddProguardMappingFileFunc = self._lib.AddProguardMappingFile
260 self._AddProguardMappingFileFunc.restype = ct.c_bool
261 self._GetSupportedTraceOffCpuModesFunc = self._lib.GetSupportedTraceOffCpuModes
262 self._GetSupportedTraceOffCpuModesFunc.restype = ct.c_char_p
263 self._SetTraceOffCpuModeFunc = self._lib.SetTraceOffCpuMode
264 self._SetTraceOffCpuModeFunc.restype = ct.c_bool
265 self._SetSampleFilterFunc = self._lib.SetSampleFilter
266 self._SetSampleFilterFunc.restype = ct.c_bool
267 self._AggregateThreadsFunc = self._lib.AggregateThreads
268 self._AggregateThreadsFunc.restype = ct.c_bool
269 self._GetNextSampleFunc = self._lib.GetNextSample
270 self._GetNextSampleFunc.restype = ct.POINTER(SampleStruct)
271 self._GetEventOfCurrentSampleFunc = self._lib.GetEventOfCurrentSample
272 self._GetEventOfCurrentSampleFunc.restype = ct.POINTER(EventStruct)
273 self._GetSymbolOfCurrentSampleFunc = self._lib.GetSymbolOfCurrentSample
274 self._GetSymbolOfCurrentSampleFunc.restype = ct.POINTER(SymbolStruct)
275 self._GetCallChainOfCurrentSampleFunc = self._lib.GetCallChainOfCurrentSample
276 self._GetCallChainOfCurrentSampleFunc.restype = ct.POINTER(CallChainStructure)
277 self._GetTracingDataOfCurrentSampleFunc = self._lib.GetTracingDataOfCurrentSample
278 self._GetTracingDataOfCurrentSampleFunc.restype = ct.POINTER(ct.c_char)
279 self._GetBuildIdForPathFunc = self._lib.GetBuildIdForPath
280 self._GetBuildIdForPathFunc.restype = ct.c_char_p
281 self._GetFeatureSection = self._lib.GetFeatureSection
282 self._GetFeatureSection.restype = ct.POINTER(FeatureSectionStructure)
283 self._instance = self._CreateReportLibFunc()
284 assert not _is_null(self._instance)
286 self.meta_info: Optional[Dict[str, str]] = None
287 self.current_sample: Optional[SampleStruct] = None
288 self.record_cmd: Optional[str] = None
290 def _get_native_lib(self) -> str: argument
293 def _load_dependent_lib(self): argument
296 self._libwinpthread = ct.CDLL(get_host_binary_path('libwinpthread-1.dll'))
298 def Close(self): argument
299 if self._instance:
300 self._DestroyReportLibFunc(self._instance)
301 self._instance = None
303 def SetReportOptions(self, options: ReportLibOptions): argument
307 self.AddProguardMappingFile(file_path)
309 self.ShowArtFrames(True)
311 self.SetTraceOffCpuMode(options.trace_offcpu)
313 self.SetSampleFilter(options.sample_filters)
315 self.AggregateThreads(options.aggregate_threads)
317 def SetLogSeverity(self, log_level: str = 'info'): argument
319 cond: bool = self._SetLogSeverityFunc(self.getInstance(), _char_pt(log_level))
322 def SetSymfs(self, symfs_dir: str): argument
324 cond: bool = self._SetSymfsFunc(self.getInstance(), _char_pt(symfs_dir))
327 def SetRecordFile(self, record_file: str): argument
329 cond: bool = self._SetRecordFileFunc(self.getInstance(), _char_pt(record_file))
332 def ShowIpForUnknownSymbol(self): argument
333 self._ShowIpForUnknownSymbolFunc(self.getInstance())
335 def ShowArtFrames(self, show: bool = True): argument
337 self._ShowArtFramesFunc(self.getInstance(), show)
339 def MergeJavaMethods(self, merge: bool = True): argument
348 self._MergeJavaMethodsFunc(self.getInstance(), merge)
350 def AddProguardMappingFile(self, mapping_file: Union[str, Path]): argument
352 if not self._AddProguardMappingFileFunc(self.getInstance(), _char_pt(str(mapping_file))):
355 def SetKallsymsFile(self, kallsym_file: str): argument
357 cond: bool = self._SetKallsymsFileFunc(self.getInstance(), _char_pt(kallsym_file))
360 def GetSupportedTraceOffCpuModes(self) -> List[str]: argument
370 modes_str = self._GetSupportedTraceOffCpuModesFunc(self.getInstance())
375 def SetTraceOffCpuMode(self, mode: str): argument
379 res: bool = self._SetTraceOffCpuModeFunc(self.getInstance(), _char_pt(mode))
382 def SetSampleFilter(self, filters: List[str]): argument
403 res: bool = self._SetSampleFilterFunc(self.getInstance(), filter_array, len(filters))
406 def AggregateThreads(self, thread_name_regex_list: List[str]): argument
413 res: bool = self._AggregateThreadsFunc(
414 self.getInstance(),
418 def GetNextSample(self) -> Optional[SampleStruct]: argument
420 psample = self._GetNextSampleFunc(self.getInstance())
422 self.current_sample = None
424 self.current_sample = psample[0]
425 return self.current_sample
427 def GetCurrentSample(self) -> Optional[SampleStruct]: argument
428 return self.current_sample
430 def GetEventOfCurrentSample(self) -> EventStruct: argument
431 event = self._GetEventOfCurrentSampleFunc(self.getInstance())
435 def GetSymbolOfCurrentSample(self) -> SymbolStruct: argument
436 symbol = self._GetSymbolOfCurrentSampleFunc(self.getInstance())
440 def GetCallChainOfCurrentSample(self) -> CallChainStructure: argument
441 callchain = self._GetCallChainOfCurrentSampleFunc(self.getInstance())
445 def GetTracingDataOfCurrentSample(self) -> Optional[Dict[str, Any]]: argument
446 data = self._GetTracingDataOfCurrentSampleFunc(self.getInstance())
449 event = self.GetEventOfCurrentSample()
456 def GetBuildIdForPath(self, path: str) -> str: argument
457 build_id = self._GetBuildIdForPathFunc(self.getInstance(), _char_pt(path))
461 def GetRecordCmd(self) -> str: argument
462 if self.record_cmd is not None:
463 return self.record_cmd
464 self.record_cmd = ''
465 feature_data = self._GetFeatureSection(self.getInstance(), _char_pt('cmdline'))
484 self.record_cmd = ' '.join(args)
485 return self.record_cmd
487 def _GetFeatureString(self, feature_name: str) -> str: argument
488 feature_data = self._GetFeatureSection(self.getInstance(), _char_pt(feature_name))
502 def GetArch(self) -> str: argument
503 return self._GetFeatureString('arch')
505 def MetaInfo(self) -> Dict[str, str]: argument
509 if self.meta_info is None:
510 self.meta_info = {}
511 feature_data = self._GetFeatureSection(self.getInstance(), _char_pt('meta_info'))
525 self.meta_info[str_list[i]] = str_list[i + 1]
526 return self.meta_info
528 def getInstance(self) -> ct._Pointer: argument
529 if self._instance is None:
531 return self._instance