Ë
    7^(hEG  ã                   óô  — d dl Z d dlmZ d dlZd dlZ	 d dlZd dlm	Z	 d dlZd dlmZmZ d„ Zdefd„Zd	„ Zd
„ Zd„ Z edddg«      Z eddddddœ«      Z edej.                  j1                  «       D � �ci c]  \  } }d| › �|“Œ c}} «      Z eddddddœ«      Z edej.                  j1                  «       D � �ci c]  \  } }d| › �|“Œ c}} «      Z edddddœ«      Zi ej.                  j;                  «       D � ci c]  } | e“Œ c} ¥ZddddœZejA                  ej;                  «       D � ci c]  } |  ede«      “Œ c} «       ejB                  D ]P  Z"de"› �Z#d e"› d!�dd"e"› d!�dd#e"› d!�diZ$ejA                  e$j;                  «       D � ci c]  } |  ee#e$«      “Œ c} «       ŒR d$„ Z%d%„ Z&d-d&„Z'd'„ Z(d.d(„Z)d/d)„Z*d*„ Z+d+„ Z,e-d,k(  r e,«        yy# e
$ r	  e
d«      ‚w xY wc c}} w c c}} w c c} w c c} w c c} w )0é    N)Ú
namedtuple)ÚNegationQueryzPFailed to import hatchet. `pip install llnl-hatchet` to get the correct version.)ÚCOMPUTE_METADATA_SCOPE_NAMEÚ
TritonHookc                 óX  — g }t        | t        «      s| g} | ru| D ]p  }|j                  «       }||z   D ]V  }||v rdnd}|j                  d«      d   j	                  «       j                  «       }|||fv sŒB|j                  ||z   «        Œp Œr t        |«      dk(  rt        d› d�«      ‚|S )Nú (inc)Ú ú(r   zMetric z< is not found. Use the --list flag to list available metrics)Ú
isinstanceÚlistÚlowerÚsplitÚstripÚappendÚlenÚRuntimeError)ÚmetricsÚinclusive_metricsÚexclusive_metricsÚretÚmetricÚ
raw_metricÚsuffixÚraw_metric_no_units           úT/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/triton/profiler/viewer.pyÚmatch_available_metricsr      sÊ   € Ø
€CÜ�gœtÔ$Ø�)ˆÙØò 	ˆFØ—\‘\“^ˆFØ/Ð2CÑCò �
Ø%/Ð3DÑ%D™È"�Ø%/×%5Ñ%5°cÓ%:¸1Ñ%=×%CÑ%CÓ%E×%KÑ%KÓ%MÐ"Ø˜jÐ*<Ð=Ò=Ø—J‘J˜z¨FÑ2Ô3Ùñð	ô ˆ3ƒx�1‚}Ü˜W V HÐ,hÐiÓjÐjØ€Jó    Údatabasec                 ó\   ‡— ˆfd„Šg }| D ]  } ‰|«      }|€Œ|j                  |«       Œ  |S )Nc                 ó,  •— d| vr| S | d   d   t         k(  ry t        | d   «      dk(  rt        | d   «      dk(  ry | j                  dg «      }g }|D ]  } ‰|«      }|€Œ|j                  |«       Œ  t        |«      dkD  st        |«      dk(  r|| d<   | S y )NÚframeÚnamer   r   Úchildren)r   r   Úgetr   )Únoder#   Únew_childrenÚchildÚ	new_childÚremove_frame_helpers        €r   r)   z*remove_frames.<locals>.remove_frame_helper&   s¸   ø€ Ø˜$ÑØˆKØ�‰=˜Ñ Ô$?Ò?ØÜˆt�I‰Ó 1Ò$¬¨T°*Ñ-=Ó)>À!Ò)CØØ—8‘8˜J¨Ó+ˆØˆØò 	/ˆEÙ+¨EÓ2ˆIØÑ$Ø×#Ñ# IÕ.ð	/ô ˆ|Ó˜qÒ ¤C¨£M°QÒ$6Ø+ˆD�ÑØˆKØr   )r   )r   Únew_databaser%   Únew_noder)   s       @r   Úremove_framesr,       sD   ø€ ôð$ €LØò *ˆÙ& tÓ,ˆØÑØ×Ñ Õ)ð*ð Ðr   c                 ó(  — t        j                  | «      }t        |«      }|j                  d«      }t        j
                  j                  |«      }|j                  «       }|j                  j                  D �cg c]	  }||vsŒ|‘Œ }}||||fS c c}w )Né   )
ÚjsonÚloadr,   ÚpopÚhtÚ
GraphFrameÚfrom_literalÚshow_metric_columnsÚ	dataframeÚcolumns)Úfiler   Údevice_infoÚgfr   r   r   s          r   Úget_raw_metricsr;   @   s†   € Ü�y‰y˜‹€HÜ˜XÓ&€HØ—,‘,˜q“/€KÜ	�‰×	#Ñ	# HÓ	-€BØ×.Ñ.Ó0ÐØ.0¯l©l×.BÑ.BÖf FÀfÐTeÒFešÐfÐÐfØÐ Ð"3°[Ð@Ð@ùò gs   Á9	BÂBc           	      óž  — t        j                  d| j                  dg¬«      }|D �]#  }||   D �]  }||   |   d   }||   |   d   }||   |   d   }t        j                  D ]à  }| d   |k(  }	| |	   }
d|› �|
j
                  vrŒ"d	}|d
k(  rS|dk(  r	d|dz  z  }ny|dk(  r	d|dz  z  }nk|dk(  r|dz  |z  dz  dz  dz  |dz  z  }nN|dk(  rI|dz  |dz  z  dz  |dz  z  }n4|dk(  r!|dk(  r	d|dz  z  }n!|dk(  s|dk(  rd|dz  z  }nt        d|› �«      ‚|j                  |	dfxx   |
d|› �   j                  d	«      |z  z  cc<   Œâ �Œ �Œ& |S ) Nç        Úmin_time©Úindexr7   ÚarchÚnum_smsÚ
clock_rateÚ	device_idÚflopsr   ÚCUDAÚ80g  ¸’2¼Cé   Ú89g €µbÆòBÚ90ér   g    xÇ:Aié  ç   ¢”mBÚ100i @  ç     @�@g    €„.AÚHIPÚgfx90ag  //bÅõBÚgfx941Úgfx942g ?³y”"CzUnsupported device type: )	ÚpdÚ	DataFramer@   r   Úflops_widthr7   Ú
ValueErrorÚlocÚfillna)Údfr9   Úmin_time_flopsÚdevice_typeÚdevice_indexrA   rB   rC   ÚwidthÚidxÚdevice_framesÚ	max_flopss               r   Úget_min_time_flopsra   J   sã  € Ü—\‘\ #¨R¯X©XÀ
¸|ÔL€NØ"ó lˆØ'¨Ñ4ó 	lˆLØ˜{Ñ+¨LÑ9¸&ÑAˆDØ! +Ñ.¨|Ñ<¸YÑGˆGØ$ [Ñ1°,Ñ?ÀÑMˆJÜ#×/Ñ/ò l�Ø˜‘o¨Ñ5�Ø " 3¡�Ø˜5˜'�?¨-×*?Ñ*?Ñ?ØØ�	Ø &Ò(Ø˜t’|Ø$*¨e°a©iÑ$8™	Ø šà%1°e¸a±iÑ$@™	Ø šà&-°¡m°jÑ&@ÀJÑ&OÐRVÑ&VÐZ^Ñ%^ÐchÐklÑclÑ$m™	Ø šØ%,¨u¡_¸
ÀSÑ8HÑ%IÈCÑ%OÐTYÐ\]ÑT]Ñ$^™	Ø  EÒ)Ø˜xÒ'Ø$*¨e°a©iÑ$8™	Ø Ò)¨T°XÒ-=Ø$-°¸±Ñ$;™	ä$Ð'@ÀÀÐ%NÓOÐOØ×"Ñ" 3¨
 ?Ó3°}ÀuÈUÈGÀ_Ñ7U×7\Ñ7\Ð]^Ó7_ÐbkÑ7kÑkÔ3ò1lò		lðlð< Ðr   c                 ó  — t        j                  d| j                  dg¬«      }|D ]\  }||   D ]R  }| d   |k(  }| |   }||   |   d   }||   |   d   }d|z  |z  dz  d	z  }	|j                  |dfxx   |d
   |	z  z  cc<   ŒT Œ^ |S )Nr=   r>   r?   rD   Úmemory_clock_rateÚ	bus_widthé   rN   rH   Úbytes)rS   rT   r@   rW   )
rY   r9   Úmin_time_bytesr[   r\   r^   r_   rc   rd   Úpeak_bandwidths
             r   Úget_min_time_bytesri   m   sÇ   € Ü—\‘\ #¨R¯X©XÀ
¸|ÔL€NØ"ò [ˆØ'¨Ñ4ò 	[ˆLØ�[‘/ \Ñ1ˆCØ˜s™GˆMØ +¨KÑ 8¸Ñ FÐGZÑ [ÐØ# KÑ0°Ñ>¸{ÑKˆIØ ™]Ð->Ñ>ÀÑDÀqÑHˆNØ×Ñ˜s J˜Ó/°=ÀÑ3IÈNÑ3ZÑZÔ/ñ	[ð[ð Ðr   Ú
FactorDictr"   ÚfactorÚtimer.   gü©ñÒMbP?g�íµ ÷Æ°>g•Ö&è.>)ztime/sztime/msztime/usztime/nsÚavg_timeÚavg_Úcpu_time)z
cpu_time/szcpu_time/mszcpu_time/uszcpu_time/nsÚavg_cpu_timerf   g    eÍÍArL   )zbyte/szgbyte/sztbyte/s)zflop/szgflop/sztflop/srE   Úflopz/sÚgflopÚtflopc                 óÎ  ‡‡— g }ˆˆfd„}|D �]…  }|dk(  rÈt        | j                  |«      }t        | j                  |«      }	 || j                  dt        «      }
| j                  d   j	                  «       }|	d   j                  |d   t        «      |
z  | j                  d<   t        j                  | j                  j                  |df<   |j                  d«       ŒÑ|t        v r…t        |   }|j                  }|j                  }t        |‰‰«      d   }| j                  |    || j                  dt        «      z  ||   z  | j                  |› d�<   |j                  |› d�«       �Œ^|t        j                  v s6|t        j                  v s$|t         j                  v s|t"        j                  v rô|t        j                  v xs |t"        j                  v }|t         j                  v xs |t"        j                  v }|r|rt"        nt        n|rt         nt        }|rdnd}|j                  d	z   |j%                  d	«      d
   z   } || j                  ||«      }|r|| j                  d   z  }||j                  |   z  | j                  |› d�<   |j                  |› d�«       �Œš|j%                  d	«      }|d   }t'        |«      d
kD  r§|d
   }|dk7  rt)        d|› �«      ‚t        |‰‰«      d   }| j                  |   }d}d|v rd}| j                  |   j*                  d   }n| j                  |   j-                  «       }||z  dz  | j                  ||z   <   |j                  ||z   «       �Œet        |‰‰«      d   }|j                  |«       �Œˆ |D ]J  }|j/                  d«      r| j0                  j                  |«       Œ0| j2                  j                  |«       ŒL |S )Nc                 óº   •— t        |‰‰«      d   }|j                  dz   |j                  d«      d   j                  d«      d   z   }| |   |j                  |   z  S )Nr   ú/r
   r.   ú))r   r"   r   rk   )rY   r   Úfactor_dictÚtime_metric_nameÚ	time_unitr   r   s        €€r   Úget_time_secondsz(derive_metrics.<locals>.get_time_seconds—   sn   ø€ Ü2°6Ð;LÐN_Ó`ÐabÑcÐØ ×%Ñ%¨Ñ+Ð.>×.DÑ.DÀSÓ.IÈ!Ñ.L×.RÑ.RÐSVÓ.WÐXYÑ.ZÑZˆ	ØÐ"Ñ# k×&8Ñ&8¸Ñ&CÑCÐCr   Úutilrl   rD   r>   r   r   ro   rv   r.   zcount (inc)ú%zUnsupported unit r	   z(inc)g      Y@)ri   r6   ra   Útime_factor_dictÚisnaÚcombineÚmaxÚnpÚnanrW   r   Úderivable_metricsr"   rk   r   Úcpu_time_factor_dictÚavg_time_factor_dictÚavg_cpu_time_factor_dictr   r   rV   ÚilocÚsumÚendswithÚinc_metricsÚexc_metrics)r:   r   r   r   r9   Úderived_metricsr{   r   rg   rZ   Útime_secÚinternal_frame_indicesÚderivable_metricÚmetric_nameÚmetric_factor_dictÚmatched_metric_nameÚis_cpuÚis_avgrx   Úmetric_time_unitÚ
time_valueÚmetric_name_and_unitÚmetric_unitÚsingle_framer   ÚtotalÚderived_metrics     ``                       r   Úderive_metricsr�   ”   sç  ù€ Ø€OõDð
 ó 5<ˆØ�VÒÜ/°·±¸kÓJˆNÜ/°·±¸kÓJˆNÙ'¨¯©°fÔ>NÓOˆHØ%'§\¡\°+Ñ%>×%CÑ%CÓ%EÐ"Ø#1°*Ñ#=×#EÑ#EÀnÐU_ÑF`ÔbeÓ#fÐiqÑ#qˆB�L‰L˜Ñ Ü?A¿v¹vˆB�L‰L×ÑÐ3°VÐ;Ñ<Ø×"Ñ" 6Õ*ØÔ(Ñ(Ü0°Ñ8ÐØ*×/Ñ/ˆKØ!1×!8Ñ!8ÐÜ"9¸+ÐGXÐZkÓ"lÐmnÑ"oÐØ/1¯|©|Ð<OÑ/PÙ0@ÀÇÁÈvÔWgÓ0hñ0jà/AÀ&Ñ/Iñ0JˆB�L‰L˜F˜8 6Ð*Ñ+ð ×"Ñ" f X¨VÐ#4Ö5ØÔ'×.Ñ.Ñ.°&Ô<P×<WÑ<WÑ2WØÔ.×5Ñ5Ñ5¸ÔC[×CbÑCbÑ9bØÔ3×:Ñ:Ð:Òg¸fÔH`×HgÑHgÐ>gˆFØÔ3×:Ñ:Ð:Òg¸fÔH`×HgÑHgÐ>gˆFá\b±vÕ3ÕCWÙ.4Õ*Ô:Jð á(.™*°FˆKØ*×/Ñ/°#Ñ5¸¿¹ÀSÓ8IÈ!Ñ8LÑLÐá)¨"¯,©,¸À[ÓQˆJÙØ'¨"¯,©,°}Ñ*EÑE�
à.8¸;×;MÑ;MÐN^Ñ;_Ñ._ˆB�L‰L˜F˜8 6Ð*Ñ+Ø×"Ñ" f X¨VÐ#4Ö5à#)§<¡<°Ó#4Ð Ø.¨qÑ1ˆKÜÐ'Ó(¨1Ò,Ø2°1Ñ5�Ø #Ò%Ü$Ð'8¸¸Ð%FÓGÐGÜ&=¸kÐK\Ð^oÓ&pÐqrÑ&sÐ#Ø!Ÿ|™|Ð,?Ñ@�Ø�ØÐ1Ñ1Ø%�FØŸL™LÐ)<Ñ=×BÑBÀ1ÑE‘EàŸL™LÐ)<Ñ=×AÑAÓC�EØ1=ÀÑ1EÈÑ0N�—‘˜V f™_Ñ-Ø×&Ñ& v°¡Ö7ä&=¸kÐK\Ð^oÓ&pÐqrÑ&sÐ#Ø×&Ñ&Ð':Ö;ðk5<ðp *ò 2ˆØ×"Ñ" 7Ô+Ø�N‰N×!Ñ! .Õ1à�N‰N×!Ñ! .Õ1ð	2ð Ðr   c                 ó4  — |dk(  r.| j                   d   j                  d„ «      | j                   d<   | S |dk(  r.| j                   d   j                  d„ «      | j                   d<   | S |dk(  r,| j                   d   j                  d„ «      | j                   d<   | S )NÚfile_function_liner"   c                 ó*   — | j                  d«      d   S )Nrv   éÿÿÿÿ©r   ©Úxs    r   ú<lambda>zformat_frames.<locals>.<lambda>ß   ó   € ÀAÇGÁGÈCÃLÐQSÑDT€ r   Úfunction_linec                 ó*   — | j                  d«      d   S )Nú:r¡   r¢   r£   s    r   r¥   zformat_frames.<locals>.<lambda>á   r¦   r   Úfile_functionc                 ó    — | j                  d«      d   j                  d«      d   › d| j                  d«      d   j                  d«      d   › �S )Nrv   r¡   r©   r   ú@r¢   r£   s    r   r¥   zformat_frames.<locals>.<lambda>ä   sO   € ˜Ÿ™ › bÑ)×/Ñ/°Ó4°QÑ7Ð8¸¸!¿'¹'À#»,ÀrÑ:J×:PÑ:PÐQTÓ:UÐVWÑ:XÐ9YÐZ€ r   )r6   Úapply)r:   Úformats     r   Úformat_framesr¯   Ý   sž   € ØÐ%Ò%Ø!Ÿ|™|¨FÑ3×9Ñ9Ñ:TÓUˆ�‰�VÑð €Ið 
�?Ò	"Ø!Ÿ|™|¨FÑ3×9Ñ9Ñ:TÓUˆ�‰�VÑð €Ið 
�?Ò	"Ø!Ÿ|™|¨FÑ3×9Ñ9ÙZó \ˆ�‰�VÑà€Ir   c                 óÄ   — |rd|› d�}| j                  |d¬«      } |r$d|› d�}t        |«      }| j                  |d¬«      } |rd|d|› �ig}| j                  |d¬«      } | S )Nz1
MATCH ("*")->(".", p)->("*")
WHERE p."name" =~ "z"
T)Úsquashz*
MATCH (".", p)->("*")
WHERE p."name" =~ "Ú*z>= )Úfilterr   )r:   ÚincludeÚexcludeÚ	thresholdr   ÚqueryÚinclusion_querys          r   Úfilter_framesr¹   è   s–   € Ùðà�9ð ðˆð �Y‰Y�u TˆYÓ*ˆÙðà�9ð ðˆô ˜oÓ.ˆØ�Y‰Y�u TˆYÓ*ˆÙØ�v  Y KÐ0Ð1Ð2ˆØ�Y‰Y�u TˆYÓ*ˆØ€Ir   c                 óŒ   — d|v r@| j                   d   j                  }t        j                  |«      }|dk  rt	        d«       y y y )Nzbytes (inc)r   zZWarning: Negative byte values detected, this is usually the result of a datatype overflow
)r6   Úvaluesr‚   ÚnanminÚprint)r:   r   Úbyte_valuesÚmin_byte_values       r   Úemit_warningsrÀ   ü   sG   € Ø˜ÑØ—l‘l =Ñ1×8Ñ8ˆÜŸ™ ;Ó/ˆØ˜AÒÜÐoÕpð ð  r   c           	      óø  — t        | |«      } t        | j                  |d|d¬«      «       |rÂt        d|d   z   «       | j                  j	                  |d   gd¬«      }t        dt        |«      «      D ]x  }t        |j                  |   d   «      d	kD  r|j                  |   d   d d	 d
z   n|j                  |   d   }t        dj                  ||j                  |   |d      «      «       Œz t        | |«       y )NTF)Úmetric_columnÚexpand_nameÚdepthÚrender_headerzSorted kernels by metric r   )ÚbyÚ	ascendingr.   r"   éd   z...z{:105} {:.4})
r¯   r½   Útreer6   Úsort_valuesÚranger   rˆ   r®   rÀ   )r:   r   rÄ   r®   Úprint_sortedÚ	sorted_dfÚrowÚkernel_names           r   Ú
print_treerÐ     s  € Ü	�r˜6Ó	"€BÜ	ˆ"�'‰' °TÀÐV[ˆ'Ó
\Ô]áÜÐ)¨G°A©JÑ6Ô7Ø—L‘L×,Ñ,°¸±°ÈÐ,ÓNˆ	Ü˜œC 	›NÓ+ò 	WˆCÜGJØ—‘˜sÑ# FÑ+óH-Ø/2òH3˜)Ÿ.™.¨Ñ-¨fÑ5°d°sÐ;¸eÒCØ8A¿¹ÀsÑ8KÈFÑ8Sð ä�.×'Ñ'¨°Y·^±^ÀCÑ5HÈÐQRÉÑ5TÓUÕVð	Wô �"�gÕr   c           	      ó   — t        |d«      5 }t        |«      \  }}}}	t        ||z   «      dkD  sJ d«       ‚|j                  «        t	        || |||	«      } t        ||||| d   «      }|| fcd d d «       S # 1 sw Y   y xY w)NÚrr   z"No metrics found in the input file)Úopenr;   r   Úupdate_inclusive_columnsr�   r¹   )
r   Úfilenamer´   rµ   r¶   Úfr:   r   r   r9   s
             r   Úparser×     s—   € Ü	ˆh˜Ó	ð  Ü@OÐPQÓ@RÑ=ˆÐÐ0°+ÜÐ$Ð'8Ñ8Ó9¸AÒ=ÐcÐ?cÓcÐ=Ø
×#Ñ#Ô%Ü   WÐ.?ÐARÐT_Ó`ˆä˜2˜w¨°¸GÀA¹JÓGˆØ�7ˆ{÷÷ ò ús   �AA4Á4A=c                 ó®  — t        | d«      5 }t        |«      \  }}}}t        d«       |rE|D ]@  }|j                  d«      d   j	                  «       j                  «       }t        d|› �«       ŒB t        d«       |rE|D ]@  }|j                  d«      d   j	                  «       j                  «       }t        d|› �«       ŒB d d d «       y # 1 sw Y   y xY w)NrÒ   zAvailable inclusive metrics:r
   r   z- zAvailable exclusive metrics:)rÓ   r;   r½   r   r   r   )Ú	file_namerÖ   Ú_r   r   r   r   s          r   Úshow_metricsrÛ     sâ   € Ü	ˆi˜Ó	ð 1 Ü5DÀQÓ5GÑ2ˆÐÐ/°ÜÐ,Ô-ÙØ/ò 1�
Ø%/×%5Ñ%5°cÓ%:¸1Ñ%=×%CÑ%CÓ%E×%KÑ%KÓ%MÐ"Ü˜Ð-Ð.Ð/Õ0ð1ô 	Ð,Ô-ÙØ/ò 1�
Ø%/×%5Ñ%5°cÓ%:¸1Ñ%=×%CÑ%CÓ%E×%KÑ%KÓ%MÐ"Ü˜Ð-Ð.Ð/Õ0ð1÷1÷ 1ñ 1ús   �B5CÃCc                  óH  — t        j                  dt         j                  ¬«      } | j                  dddd¬«       | j                  dd	t        d d
¬«       | j                  ddt        d d¬«       | j                  ddt        d d¬«       | j                  ddt
        d d¬«       | j                  ddt        dd¬«       | j                  ddt        g d¢dd¬«       | j                  ddd d!¬"«       | j                  d#d$t        d d%¬«       | j                  «       \  }}t        |«      d&k(  sJ d'«       ‚|d(   }|j                  r|j                  j                  d)«      nd }|j                  }|j                  }|j                  }|j                  }|j                  }	|j                   }
|j"                  }|r|rt%        d*«      ‚|j&                  rt)        |«       y |rGt+        |||||«      \  }}|
r#t+        ||
|||«      \  }}|j-                  |«      }t/        ||||	|«       y y )+Nz,Performance data viewer for proton profiles.)ÚdescriptionÚformatter_classz-lz--listÚ
store_truea,  List available metrics. Metric names are case insensitive and ignore units.
Derived metrics can be created when source metrics are available.
- time/s, time/ms, time/us, time/ns: time
- avg_time/s, avg_time/ms, avg_time/us, avg_time/ns: time / count
- flop[<8/16/32/64>]/s, gflop[<8/16/32/64>]/s, tflop[<8/16/32/64>]/s: flops / time
- byte/s, gbyte/s, tbyte/s: bytes / time
- util: max(sum(flops<width>) / peak_flops<width>_time, sum(bytes) / peak_bandwidth_time)
- <metric>/%%: frame(metric) / sum(metric). Only availble for inclusive metrics (e.g. time)
)ÚactionÚhelpz-mz	--metricszÐAt maximum two metrics can be specified, separated by comma.
There are two modes:
1) Choose the output metric to display. It's case insensitive and ignore units.
2) Derive a new metric from existing metrics.
)ÚtypeÚdefaultrá   z-iz	--includea  Find frames that match the given regular expression and return all nodes in the paths that pass through the matching frames.
For example, the following command will display all paths that contain frames that contains "test":
```
proton-viewer -i ".*test.*" path/to/file.json
```
z-ez	--excludezæExclude frames that match the given regular expression and their children.
For example, the following command will exclude all paths starting from frames that contains "test":
```
proton-viewer -e ".*test.*" path/to/file.json
```
z-tz--thresholdzrExclude frames(kernels) whose metrics are below the given threshold. This filter only applies on the first metric.z-dz--depthrÈ   z The depth of the tree to displayz-fz--format)ÚfullrŸ   r§   rª   rä   a!  Formatting the frame name.
- full: include the path, file name, function name and line number.
- file_function_line: include the file name, function name and line number.
- function_line: include the function name and line number.
- file_function: include the file name and function name.
)râ   Úchoicesrã   rá   z--print-sortedFz6Sort output by metric value instead of chronologically)rà   rã   rá   z--diff-profilez-diffzŒCompare two profiles. When used as 'proton-viewer -m time -diff file1.log file2.log', computes the difference: file2['time'] - file1['time']r.   zMust specify a file to readr   ú,z'Cannot specify both include and exclude)ÚargparseÚArgumentParserÚRawTextHelpFormatterÚadd_argumentÚstrÚfloatÚintÚparse_known_argsr   r   r   r´   rµ   r¶   rÄ   r®   Údiff_profilerÌ   rV   r   rÛ   r×   ÚsubrÐ   )Ú	argparserÚargsÚtarget_argsrÙ   r   r´   rµ   r¶   rÄ   r®   ÚdiffrÌ   r:   r�   Úgf2rÚ   s                   r   Úmainrö   ,  ss  € Ü×'Ñ'ØBÜ ×5Ñ5ô€Ið ×ÑØØØðð	 ô ð ×ÑØØÜØðð ô 
ð ×ÑØØÜØð	ð ô ð ×ÑØØÜØðð ô ð ×ÑØØÜØà|ð ô ð ×ÑØØÜØØ/ð ô ð ×ÑØˆjœsÒ,lØð ð ô ð ×ÑØØØØEð	 ô ð ×ÑØ˜'¬°TðAð ô Bð
 "×2Ñ2Ó4Ñ€Dˆ+Üˆ{Ó˜qÒ Ð?Ð"?Ó?Ð à˜A‘€IØ)-¯ªˆd�l‰l× Ñ  Ô%¸4€GØ�l‰l€GØ�l‰l€GØ—‘€IØ�J‰J€EØ�[‰[€FØ×Ñ€DØ×$Ñ$€LÙ‘7ÜÐBÓCÐCØ‡y‚yÜ�YÕÙ	Ü# G¨Y¸ÀÈ)ÓTÑˆˆOÙÜ˜7 D¨'°7¸IÓF‰FˆC�Ø—‘˜“ˆBÜ�2�¨¨v°|ÕDð 
r   Ú__main__)NNNN)rÈ   NF)NNN).rç   Úcollectionsr   r/   ÚpandasrS   Úhatchetr2   Úhatchet.queryr   ÚImportErrorÚnumpyr‚   Útriton.profiler.hookr   r   r   r,   r;   ra   ri   rj   r~   rk   Úitemsr†   r…   r‡   Úbytes_factor_dictÚkeysr„   Údefault_flop_factor_dictÚupdaterU   r]   Úfactor_namerx   r�   r¯   r¹   rÀ   rÐ   r×   rÛ   rö   Ú__name__)ÚkeyÚvalues   00r   ú<module>r     s¡  ðÛ Ý "Û Û ðjÛÝ+ó ß Hòð$˜Dó ò@Aò òF
ñ ˜ v¨xÐ&8Ó9€
Ù˜f°¸tÐPTÐaeÑ&fÓgÐ Ù! *ÐUe×UlÑUl×UrÑUrÓUt×.uÁzÀsÈE°°c°U¨|¸UÑ/BÓ.uÓvÐ Ù! *Ø12À4ÐX\ÐmqÑ"rótÐ á% nà9M×9TÑ9T×9ZÑ9ZÓ9\÷'^Ù+5¨3°ð *.¨c¨U |°UÑ':ó '^ó_Ð ñ ˜w°1ÀÐQUÑ(VÓWÐ ðà#×*Ñ*×/Ñ/Ó1ö3Øð ÐÑò 3ðÐ ð '(°CÀDÑIÐ Ø × Ñ à(×-Ñ-Ó/ö1Ø	ð 	‰*�WÐ6Ó
7Ñ7ò 1ô2ð ×#Ñ#ò h€EØ˜%˜�/€KØ˜%˜ Ð# Q¨%°¨w°bÐ(9¸3À%ÈÀwÈbÐ@QÐSWÐX€KØ×ÑÐS^×ScÑScÓSeÖfÈC˜c¡:¨k¸;Ó#GÑGÒfÕgðhòFòRóò(qóóò1ònEðb ˆzÒÙ…Fð øðk ò jÙ
ÐhÓ
iÐiðjüóh /vùó'^ùò
3ùò1ùò
 gs)   ”
G Á5GÂ;G%Ã=
G+Ä.G0ÆG5
ÇG