danial27@castor:~/lab-4-valentino-jaber/task2$ make detailed valgrind -v --tool=cachegrind --D1=4096,4,64 --LL=16384,8,64 --cachegrind-out-file=stats.cgout ./task2 ==3778474== Cachegrind, a cache and branch-prediction profiler ==3778474== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al. ==3778474== Using Valgrind-3.15.0-608cb11914-20190413 and LibVEX; rerun with -h for copyright info ==3778474== Command: ./task2 ==3778474== --3778474-- Valgrind options: --3778474-- -v --3778474-- --tool=cachegrind --3778474-- --D1=4096,4,64 --3778474-- --LL=16384,8,64 --3778474-- --cachegrind-out-file=stats.cgout --3778474-- Contents of /proc/version: --3778474-- Linux version 5.4.0-128-generic (buildd@bos02-arm64-058) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #144-Ubuntu SMP Tue Sep 20 11:03:09 UTC 2022 --3778474-- --3778474-- Arch and hwcaps: ARM64, LittleEndian, baseline --3778474-- Page sizes: currently 4096, max supported 65536 --3778474-- Valgrind library directory: /usr/lib/aarch64-linux-gnu/valgrind --3778474-- Warning: Cannot auto-detect cache config, using defaults. --3778474-- Run with -v to see. ==3778474== Cache configuration used: ==3778474== I1: 16,384 B, 4-way, 64 B lines ==3778474== D1: 4,096 B, 4-way, 64 B lines ==3778474== LL: 16,384 B, 8-way, 64 B lines --3778474-- Reading syms from /ubc/ece/home/ugrads/d/danial27/lab-4-valentino-jaber/task2/task2 --3778474-- object doesn't have a dynamic symbol table --3778474-- Reading syms from /usr/lib/aarch64-linux-gnu/valgrind/cachegrind-arm64-linux --3778474-- object doesn't have a symbol table --3778474-- object doesn't have a dynamic symbol table --3778474-- Scheduler: using generic scheduler lock implementation. ==3778474== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-3778474-by-danial27-on-??? ==3778474== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-3778474-by-danial27-on-??? ==3778474== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-3778474-by-danial27-on-??? ==3778474== ==3778474== TO CONTROL THIS PROCESS USING vgdb (which you probably ==3778474== don't want to do, unless you know exactly what you're doing, ==3778474== or are doing some strange experiment): ==3778474== /usr/lib/aarch64-linux-gnu/valgrind/../../bin/vgdb --pid=3778474 ...command... ==3778474== ==3778474== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==3778474== /path/to/gdb ./task2 ==3778474== and then give GDB the following command ==3778474== target remote | /usr/lib/aarch64-linux-gnu/valgrind/../../bin/vgdb --pid=3778474 ==3778474== --pid is optional if only one valgrind process is running ==3778474== ==3778474== ==3778474== I refs: 81,758,017 ==3778474== I1 misses: 359 ==3778474== LLi misses: 357 ==3778474== I1 miss rate: 0.00% ==3778474== LLi miss rate: 0.00% ==3778474== ==3778474== D refs: 29,606,253 (22,204,736 rd + 7,401,517 wr) ==3778474== D1 misses: 22,205,029 (14,804,900 rd + 7,400,129 wr) ==3778474== LLd misses: 22,204,942 (14,804,827 rd + 7,400,115 wr) ==3778474== D1 miss rate: 75.0% ( 66.7% + 100.0% ) ==3778474== LLd miss rate: 75.0% ( 66.7% + 100.0% ) ==3778474== ==3778474== LL refs: 22,205,388 (14,805,259 rd + 7,400,129 wr) ==3778474== LL misses: 22,205,299 (14,805,184 rd + 7,400,115 wr) ==3778474== LL miss rate: 19.9% ( 14.2% + 100.0% ) cg_annotate --show-percs=no stats.cgout | tee stats.rep -------------------------------------------------------------------------------- I1 cache: 16384 B, 64 B, 4-way associative D1 cache: 4096 B, 64 B, 4-way associative LL cache: 16384 B, 64 B, 8-way associative Command: ./task2 Data file: stats.cgout Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Events shown: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Event sort order: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Thresholds: 0.1 100 100 100 100 100 100 100 100 Include dirs: User annotated: Auto-annotation: off -------------------------------------------------------------------------------- Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw -------------------------------------------------------------------------------- 81,758,017 359 357 22,204,736 14,804,900 14,804,827 7,401,517 7,400,129 7,400,115 PROGRAM TOTALS -------------------------------------------------------------------------------- Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw file:function -------------------------------------------------------------------------------- 81,736,708 2 2 22,200,000 14,804,623 14,804,623 7,400,000 7,400,000 7,399,999 /ubc/ece/home/ugrads/d/danial27/lab-4-valentino-jaber/task2/task2.c:func1