| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z dd� Z
dd� ZG dd� d�ZG d d
� d
e�Z
G dd� de�ZG d
d� d�ZG dd� deej�ZG dd� deej�ZG dd� deej�ZG dd� deej�Zedkrze�� dS dS )� N)�findfilec C s t j�t| dd��S )N�
dtracedata)�subdir)�os�path�abspathr )�filename� r �'/usr/lib/python3.10/test/test_dtrace.pyr s r c C sl t �dd| �} zdd� | �� D �}|jdd� d� dd� |D �}d �|�W S ttfy5 td
�| ���w )aM Normalize DTrace output for comparison.
DTrace keeps a per-CPU buffer, and when showing the fired probes, buffers
are concatenated. So if the operating system moves our thread around, the
straight result can be "non-causal". So we add timestamps to the probe
firing, sort by that field, then strip it from the outputz\[[0-9]+ refs\]� c S s$ g | ]}|r|� d �s|�d��qS )�#� )�
startswith�split��.0�rowr r r
�
<listcomp> s ���z*normalize_trace_output.<locals>.<listcomp>c S s t | d �S )Nr )�int)r r r r
�<lambda> s z(normalize_trace_output.<locals>.<lambda>)�keyc S s g | ]}|d �qS )� r r r r r
r ! s �
z%tracer produced unparsable output:
{}) �re�sub�
splitlines�sort�join�
IndexError�
ValueError�AssertionError�format)�output�resultr r r
�normalize_trace_output s ���r$ c @ sH e Zd ZdZdZg Zddd�Zddd�Zddd�Zddd �Z d
d� Z
dS )
�TraceBackendNc C sv t | jt|| j �t|d �|d��}tt|| j d ���}|�� �� }W d � ||fS 1 s2w Y ||fS )Nz.py)�script_file�python_file�optimize_pythonz .expected)r$ �trace_pythonr � EXTENSION�open�read�rstrip)�self�namer( �
actual_output�f�expected_outputr r r
�run_case. s
�
��zTraceBackend.run_casec C s | j |g }|r|d|g7 }|S )Nz-c)�COMMAND)r. r&