%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
a
�_g� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z m
Z
dd� Zdd� ZG dd� d�Z
G d d
� d
e
�ZG dd� de
�ZG d
d� dej�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zdd� Zedkr�e� dS )� N)�findfile�run_unittestc C s t j�t| dd��S )NZ
dtracedata)Zsubdir)�os�path�abspathr )�filename� r �//vddos/python/lib/python3.9/test/test_dtrace.pyr s r c C st t �dd| �} z<dd� | �� D �}|jdd� d� dd� |D �}d �|�W S ttfyn td
�| ���Y n0 dS )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> � z(normalize_trace_output.<locals>.<lambda>)�keyc S s g | ]}|d �qS )� r r r r r r ! r �
z&tracer produced unparseable output:
{}N) �re�sub�
splitlines�sort�join�
IndexError�
ValueError�AssertionError�format)�output�resultr r r �normalize_trace_output s ��r$ c @ sH e Zd ZdZdZg Zddd�Zd
dd�Zddd�Zddd �Z d
d� Z
dS )�TraceBackendNc C sp t | jt|| j �t|d �|d��}tt|| j d ���}|�� �� }W d � n1 s^0 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&