Files
csapp2025/cachelab
2025-04-25 08:29:08 +08:00
..
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00
2025-04-25 08:29:08 +08:00
2025-04-25 08:29:08 +08:00
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00
2025-04-25 08:29:08 +08:00
2025-04-21 23:52:27 +08:00
2025-04-21 23:52:27 +08:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

注意你只能修改Cache.c文件其他文件请勿修改


Linux:
  1. make
  2. ./Cache traces/long.trace.zst

提醒:Linux下需要安装libzstd-dev软件包例如apt install libzstd-dev zstd

Windows VS 2019:
  1. 进入MyCache目录打开MyCache.sln
  2. 编译即可生成可执行文件
  3. 启动命令行窗口, 运行.\MyCache.exe traces/long.trace.zst


提示在traces目录下有多个trace可以跑。


自行生成trace文件
1、安装valgrindUbuntu下可以使用apt install valgrind完成
2、运行valgrind生成某个应用的trace文件。比如为了生成ls命令运行时的trace可以输入下列命令
valgrind --tool=lackey -v --trace-mem=yes --log-file=ls.trace ls -l
3、将生成的trace文件打包为zst压缩格式例如
   zstd ls.trace -o ls.trace.zst
4、使用Cache跑这个trace
   ./Cache ./ls.trace.zst