99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫cs250編程、代做C++程序語言
代寫cs250編程、代做C++程序語言

時間:2024-11-07  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Project 5: Profiling an Assembly Program
Goal
In this project you will learn how to find where a program spends most of the execution time
using statistical profiling, and you will implement your own statistical profiler.
Task 0: Download the initial sources and start tsearch_asm6.s
To start your project clone the project5 repository:
git clone /homes/cs250/sourcecontrol/work/$USER/project5-src.git
cd project5-src
The implementation of binary tree search in C is similar to the one from project4. You will copy
your implementation from tsearch_asm5.s into tsearch_asm6.s
To test the implementation type
data 149 $ ./run_bench.sh
================== Running TreeSearch Iterative in C benchmark ================
Total CPU time: 4.125084397 seconds
real 0m7.960s
user 0m7.830s
sys 0m0.124s
================== Running ASM 6 benchmark ================

It will also try to run the tsearch_asm6.s but it will fail if it is not implemented yet.
Task 1:Insert profiling code in the benchmark
The file profil.c implements the code that starts profiling the program, and writes the histogram
of the file at the end:
void start_histogram();
void print_histogram();
Open the file profil.c and see how start_histogram creates an array of counters, that is passed
to profil(), that creates the execution histogram. See "man profil". This histogram is an array of
integers, where every integer represents an instruction or group of instruction. profil() activates a
timer that every .01secs looks at the program counter of the program, and increments the
counter in the histogram that corresponds to that program counter.
Open the file tsearch_bench_better.c and find the main(). Then above main, you will insert the
external prototypes of start_histogram() and print_histogram(): as follows. Also call
start_histogram() at the beginning of main() and print_histogram() at the end.
extern void start_histogram();
extern void print_histogram();
/*
* Main program function. Runs the benchmark.
*/
__attribute__ (( visibility("default") ))
int
main(int argc, char **argv)
start_histogram();
…..
print_histogram();
}
Modify run_bench, so both gcc compilation commands link profil.c
echo ================== Running TreeSearch Iterative in C benchmark ================
gcc -g -static -o tsearch_bench_iterative_c tsearch_bench_better.c tsearch.c AVLTree.c tsearch_iterative.c profil.c || exit 1

gcc -g -static -o tsearch_bench_asm6 tsearch_bench_better.c tsearch.c AVLTree.c tsearch_asm6.s profil.c || exit 1

Now type run_bench.
data149 $ ./run_bench.sh
You will find the following file:
ls *.hist
tsearch_bench_iterative_c.hist
Open this file, and you will observe that it contains the program counters in the histogram that
are larger than 0. The counter is multiplied by 1ms, so the counters are displayed in ms. Identify
the program counter where the program is spent most of its time:

0x45b86a 60ms
0x45b870 1120ms
0x45b878 10ms
0x45b87c 30ms

Then run the command "nm -v tsearch_bench_iterative_c | less"that prints all the functions in
the program sorted by address, and finds the function that includes this program counter. Use
the up/down arrow keys to navigate "less".
data 163 $ nm -v tsearch_bench_iterative_c | less
….
000000000045aee0 T __stpcpy_evex
000000000045b340 T __strchr_evex
000000000045b5e0 T __strchrnul_evex
000000000045b840 T __strcmp_evex
000000000045bcb0 T __strcpy_evex
000000000045c100 T __strlen_evex
000000000045c280 T __strncmp_evex
000000000045c7f0 T __strncpy_evex
….
__strcmp_evex is the function where tsearch_bench_iterative_c spends most of its time.
Now to find the assembly instruction type "objdump -d tsearch_bench_iterative_c | less" that
prints the assembly instructions that make the program and their address in the program. Find
the assembly instruction that includes the counter 45b870, that is 45b86c . This is because
0x45b870 is larger than 45b86c but smaller than 45b8**.
objdump -d tsearch_bench_iterative_c | less
000000000045b840 <__strcmp_evex>:
45b840: f3 0f 1e fa endbr64
45b844: 89 f8 mov %edi,%eax
45b846: 31 d2 xor %edx,%edx
45b848: 62 a1 fd 00 ef c0 vpxorq %xmm16,%xmm16,%xmm16
45b84e: 09 f0 or %esi,%eax
45b850: 25 ff 0f 00 00 and $0xfff,%eax
45b855: 3d 80 0f 00 00 cmp $0xf80,%eax
45b85a: 0f 8f 70 03 00 00 jg 45bbd0 <__strcmp_evex+0x3**>
45b860: 62 e1 fe 28 6f 0f vmovdqu64 (%rdi),%ymm17
45b866: 62 b2 75 20 26 d1 vptestmb %ymm17,%ymm17,%k2
45b86c: 62 f3 75 22 3f 0e 00 vpcmpeqb (%rsi),%ymm17,%k1{%k2}
45b8**: c5 fb 93 c9 kmovd %k1,%ecx
45b877: ff c1 inc %ecx
45b879: 74 45 je 45b8c0 <__strcmp_evex+0x80>
45b87b: f3 0f bc d1 tzcnt %ecx,%edx
45b87f: 0f b6 04 17 movzbl (%rdi,%rdx,1),%eax
The instruction marked in red is the instruction that is taking the most time.
Task 2: Write your own profiler program.
Using the example in Task1, write a program myprof.c that prints a table with the top 10
functions where the program spends most of its time and it will also print for each function,
which instructions take most of the time . The program will take the following arguments:
myprof prog
The program will open prog.hist, and store the entries in an array of structs with the program
counter and the time in ms. Then it will call system("nm -v prog > nm.out") using the system()
function (see man system) that executes a command inside a C program, and redirect it into a
file nm.out. Myprof will read nm.out, and it will also store the entries in an array of structs with
program counters and function names. Then for every pc in the histogram, it will increment the
time in ms of the corresponding function. After this is done, it will sort the functions by time, and
identify the 10 top functions where the execution spends most of the time. Finally, it will also
print the assembly code of these functions using objdump, and print the time spend in each
assembly instruction. Only the instructions with a time greater than 0 are printed.
The output will look like the following example:
myprof tsearch_bench_iterative_c
Top 10 functions:
ith Function Time(ms) (%)
1: mystrcmp 120ms 25%
2: malloc 80ms 36%
….
Top 10 functions Assembly
1: mystrcmp 120ms 25%
120ms 42cf60: f6 c2 20 test $0x20,%dl
2: malloc 80ms 36%
20ms 4628cc: 48 89 de mov %rbx,%rsi
10ms 4628cf: e8 cc e3 ff ff call 460ca0
Task 3:Using your profiler, improve your tsearch_asm6.s
Using your profiler, optimize your implementation in tsearch_asm6.s
Grading
The grading will be done during lab time. You don't need to turn in the implementation since the
git repository will have your most recent implementation.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




 

掃一掃在手機打開當前頁
  • 上一篇:代做COMP3230、Python語言程序代寫
  • 下一篇:MSE 280代做、代寫C++,Python程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          亚洲国产综合91精品麻豆| 久久亚洲精品伦理| 影音先锋成人资源站| 欧美伦理影院| 久久www成人_看片免费不卡| 亚洲黄色精品| 国产又爽又黄的激情精品视频| 亚洲欧美资源在线| 亚洲精品日韩激情在线电影| 国产日韩精品在线播放| 欧美日韩在线一区二区| 另类成人小视频在线| 午夜精品久久久久久久久久久| 日韩一级免费观看| 亚洲国产精品久久人人爱蜜臀| 国产自产v一区二区三区c| 欧美日韩在线播放三区| 久久久久久自在自线| 亚洲欧美一区二区三区极速播放| 亚洲欧洲三级| 好看的亚洲午夜视频在线| 国产精品视频免费| 国产精品国产三级国产aⅴ无密码| 欧美日韩国产bt| 欧美国产专区| 欧美日韩国产精品一区| 欧美黑人多人双交| 欧美国产专区| 欧美日韩国产免费观看| 欧美人与禽猛交乱配| 欧美精品在线观看播放| 欧美日韩精品久久久| 欧美日韩一区国产| 国产精品欧美日韩一区| 国产精品一二| 国产日韩欧美麻豆| 精品成人一区| 99爱精品视频| 午夜精品电影| 久久网站热最新地址| 美女日韩在线中文字幕| 欧美aⅴ一区二区三区视频| 欧美激情一二区| 欧美午夜精品理论片a级按摩| 欧美视频二区| 国产一二三精品| 亚洲国产日本| 亚洲一区制服诱惑| 久久久久久久久久久成人| 免费在线看成人av| 欧美色精品天天在线观看视频| 国产精品你懂的在线欣赏| 国产在线国偷精品产拍免费yy| 在线精品在线| 亚洲午夜电影网| 久久久久成人精品| 欧美精品一区二区在线观看| 国产精品成人一区二区艾草| 国产自产v一区二区三区c| 亚洲乱码久久| 久久精品国产亚洲一区二区| 欧美精品成人| 国产女人aaa级久久久级| 亚洲激情综合| 欧美有码在线视频| 欧美精品激情在线观看| 国产午夜亚洲精品羞羞网站| 日韩天堂av| 久久婷婷av| 国产精品一区免费观看| 亚洲精品影院| 毛片精品免费在线观看| 国产视频在线观看一区二区| 亚洲美女色禁图| 久久综合久久美利坚合众国| 国产精品国产福利国产秒拍 | 国产一区二区三区日韩欧美| 亚洲精品国产拍免费91在线| 久久精品国产99| 国产精品久久久久一区二区三区| 136国产福利精品导航网址应用| 亚洲欧美第一页| 欧美人与禽猛交乱配视频| 一区国产精品| 久久精品国产99国产精品澳门| 国产精品久久久久久av下载红粉 | 久久综合精品一区| 国产欧美 在线欧美| 一区二区三区 在线观看视频| 欧美成年人网| 亚洲国产欧美一区| 久久精品一区二区三区不卡牛牛| 国产精品乱人伦中文| 亚洲一区成人| 国产精品一二三| 欧美亚洲综合网| 国产欧美日韩在线视频| 亚洲欧美日韩国产精品| 欧美性色视频在线| 亚洲免费一级电影| 国产伦精品一区二区三区高清| 亚洲已满18点击进入久久| 欧美午夜在线观看| 亚洲图色在线| 国产欧美日韩精品专区| 西西人体一区二区| 好吊色欧美一区二区三区四区| 久久久久久综合| 亚洲国产小视频在线观看| 欧美激情综合色| 中文在线资源观看网站视频免费不卡| 欧美日韩在线综合| 亚洲欧美日韩中文播放| 国产午夜精品麻豆| 美女爽到呻吟久久久久| 亚洲精品乱码久久久久久蜜桃91| 欧美日韩免费观看中文| 亚洲综合色网站| 国产综合久久久久久鬼色| 久久免费视频在线观看| 亚洲精品国产精品国自产观看 | 亚洲靠逼com| 国产精品女主播一区二区三区| 欧美一区二区网站| 亚洲国产午夜| 国产精品区一区二区三区| 久久裸体艺术| 中文精品一区二区三区| 国产一区二区三区高清在线观看 | 亚洲精品视频一区| 国产精品亚洲网站| 久久亚洲精品一区| av成人激情| 在线成人av| 国产精品美女一区二区在线观看| 久久一二三国产| 亚洲男同1069视频| 亚洲高清二区| 国产日产欧产精品推荐色| 欧美国产欧美亚州国产日韩mv天天看完整 | 在线观看91精品国产麻豆| 欧美精品一区二区蜜臀亚洲| 久久精品国产一区二区三区免费看 | 欧美日韩精品一区二区三区四区| 亚洲女ⅴideoshd黑人| 最新国产成人在线观看| 国产日韩欧美成人| 国产精品成人国产乱一区| 欧美.www| 久久露脸国产精品| 欧美一区二区三区视频免费播放| 亚洲精品美女久久久久| 亚洲电影av在线| 激情综合在线| 国产在线精品一区二区夜色| 国产精品日本一区二区 | 欧美日韩国产电影| 免费日韩成人| 毛片精品免费在线观看| 久久久999精品| 欧美在线视频二区| 欧美一级在线视频| 欧美一区三区三区高中清蜜桃| 亚洲综合色视频| 亚洲欧美中日韩| 亚洲欧美日韩国产另类专区| 亚洲视频在线一区| 妖精成人www高清在线观看| 亚洲美女免费精品视频在线观看| 韩日欧美一区二区| 国产精品久久久久久久久久久久久久| 欧美日本在线看| 欧美久久99| 国产精品久久久久免费a∨| 欧美午夜不卡| 国产精品一区一区三区| 国产一区二区三区无遮挡| 国产一区二区三区在线免费观看| 国产一区导航| 在线观看日韩av电影| 亚洲人成网站色ww在线| 夜夜嗨一区二区三区| 中国亚洲黄色| 欧美在线看片a免费观看| 久久久久久高潮国产精品视| 久久综合九色| 欧美日韩一区在线观看视频| 国产精品国产三级国产aⅴ9色| 欧美午夜精品久久久久久浪潮| 国产精品一区免费观看| 黄色另类av| 日韩性生活视频| 性刺激综合网| 欧美成人精品1314www| 国产精品vvv| 一区二区在线视频观看| 亚洲三级国产| 久久成人av少妇免费| 欧美大片第1页| 国产精品久久亚洲7777|