karan adobe
karan adobe

Reputation: 1

How to export symbols with `xctrace export`

xcode screenshot I am working on a project where we have to find the performance or the time taken by functions inside an app , i am using the following commands

$ATE_XCODE_PATH/Contents/Developer/usr/bin/xctrace record --template "Time Profiler" --launch $product_full_path $product_args --output $dir_prof_root/prof.trace to generate a .trace file which looks like the image attached

now to convert the .trace into xml i am using the command $ATE_XCODE_PATH/Contents/Developer/usr/bin/xctrace export --input $dir_prof_root/prof.trace --output $dir_prof_root/prof-time-profile.xml --xpath "trace-toc/run[@number="1"]/data/table[@schema='time-profile']"

now the generated xml does not have any symbols(function_name) in it .

the part of xml looks like below `

<?xml version="1.0"?>
<trace-query-result>
<node xpath='//trace-toc[1]/run[1]/data[1]/table[10]'><schema name="time-profile"><col><mnemonic>time</mnemonic><name>Sample Time</name><engineering-type>sample-time</engineering-type></col><col><mnemonic>thread</mnemonic><name>Thread</name><engineering-type>thread</engineering-type></col><col><mnemonic>process</mnemonic><name>Process</name><engineering-type>process</engineering-type></col><col><mnemonic>core</mnemonic><name>Core</name><engineering-type>core</engineering-type></col><col><mnemonic>thread-state</mnemonic><name>State</name><engineering-type>thread-state</engineering-type></col><col><mnemonic>weight</mnemonic><name>Weight</name><engineering-type>weight</engineering-type></col><col><mnemonic>stack</mnemonic><name>Backtrace</name><engineering-type>backtrace</engineering-type></col></schema><row><sample-time id="1" fmt="00:00.084.274">84274916</sample-time><thread id="2" fmt="Main Thread  0x13cbfd5 (autotest, pid: 8328)"><tid id="3" fmt="0x13cbfd5">20758485</tid><process id="4" fmt="autotest (8328)"><pid id="5" fmt="8328">8328</pid><device-session id="6" fmt="TODO">TODO</device-session></process></thread><process ref="4"/><core id="7" fmt="CPU 5 (Performance)">5</core><thread-state id="8" fmt="Running">Running</thread-state><weight id="9" fmt="1.00 ms">1000000</weight><backtrace id="10" fmt="0x7ff7ffd0e221 ← (1 other frames)"><process ref="4"/><text-addresses id="11" fmt="frag 9209">140703125529121</text-addresses><process ref="4"/><text-addresses id="12" fmt="frag 1338">140703125529120</text-addresses></backtrace></row>
<row><sample-time id="13" fmt="00:00.085.274">85274166</sample-time><thread ref="2"/><process ref="4"/><core id="14" fmt="CPU 7 (Performance)">7</core><thread-state ref="8"/><weight ref="9"/><backtrace id="15" fmt="0x7ff7ffd0e3bd ← (1 other frames)"><process ref="4"/><text-addresses id="16" fmt="frag 9211">140703125529533</text-addresses><process ref="4"/><text-addresses id="17" fmt="frag 1343">140703125529532</text-addresses></backtrace></row>
<row><sample-time id="18" fmt="00:00.086.275">86275500</sample-time><thread ref="2"/><process ref="4"/><core id="19" fmt="CPU 1 (Efficient)">1</core><thread-state ref="8"/><weight ref="9"/><backtrace id="20" fmt="0x10317deb9 ← (2 other frames)"><process ref="4"/><text-addresses id="21" fmt="frag 9213">4346863289</text-addresses><process ref="4"/><text-addresses id="22" fmt="frag 9214">8643138513 8642783926</text-addresses></backtrace></row>
<

where as it should have looked like

<row><sample-time id="26" fmt="00:01.269.115">1269115822</sample-time><thread ref="2"/><process ref="4"/><core ref="7"/><thread-state ref="8"/><weight ref="9"/><backtrace id="27" fmt="dyld4::PrebuiltLoader::dependent(dyld4::RuntimeState const&amp;, unsigned int, dyld4::Loader::DependentKind*) const ← (13 other frames)"><process ref="4"/><text-addresses id="28" fmt="frag 9834">4646800758</text-addresses><process ref="4"/><text-addresses id="29" fmt="frag 57">4646784005 4646784069 4646782668 4646795931 4646951124 4646949523 4646946981 4646946077 4646793401 4646792452 4646719023 4646716627 0</text-addresses></backtrace></row>
<row><sample-time id="30" fmt="00:01.270.112">1270112311</sample-time><thread ref="2"/><process ref="4"/><core ref="7"/><thread-state ref="8"/><weight ref="9"/><backtrace id="31" fmt="dyld3::MachOLoaded::trieWalk(Diagnostics&amp;, unsigned char const*, unsigned char const*, char const*) ← (13 other frames)"><process ref="4"/><text-addresses id="32" fmt="frag 9837">4646706917</text-addresses><process ref="4"/><text-addresses id="33" fmt="frag 59">4646783764 4646785103 4646782135 4646796194 4646951184 4646950419 4646947287 4646946077 4646793401 4646792452 4646719023 4646716627 0</text-addresses></backtrace></row>

see the fmt has the symbols could you please help , how to solve this

i am using the following commands

$ATE_XCODE_PATH/Contents/Developer/usr/bin/xctrace record --template "Time Profiler" --launch $product_full_path $product_args --output $dir_prof_root/prof.trace to generate a .trace file which looks like the image attached

now to convert the .trace into xml i am using the command $ATE_XCODE_PATH/Contents/Developer/usr/bin/xctrace export --input $dir_prof_root/prof.trace --output $dir_prof_root/prof-time-profile.xml --xpath "trace-toc/run[@number="1"]/data/table[@schema='time-profile']"

now the generated xml does not have any symbols(function_name) in it .

Upvotes: 0

Views: 103

Answers (0)

Related Questions