All of lore.kernel.org
 help / color / mirror / Atom feed
* Issue while testing new fvaddr feature
@ 2022-10-19  2:49 Vinicius Petrucci
  2022-10-19 17:45 ` SeongJae Park
  0 siblings, 1 reply; 5+ messages in thread
From: Vinicius Petrucci @ 2022-10-19  2:49 UTC (permalink / raw)
  To: damon

Hello,

I am experimenting with the new fixed address (fvaddr) feature of
DAMON to monitor memory regions originated from user-level mmap/malloc
calls.
I used "strace" to intercept the mmap calls and derive "start" and
"end" attributes for monitoring using the "masim" program
(https://github.com/sjp38/masim) as an example that creates two memory
allocations and keeps accessing them for a long time.
Then, I used "perf record" to get the data, but perf doesn't seem to
be recording anything. Nothing is shown after issuing "perf script".

Could you please help me spot any mistakes with my tests (if any)
using the Bash script below? Could also please let me know whether or
not that is reproducible in your system?

I am using kernel 6.0.2 and I checked that "fvaddr" is supported via
"damo features".
All steps in the script below ("test-fvaddr-damon.sh") runs without
any errors. It is just that nothing appears in the perf data.

-------- test-fvaddr-damon.sh --------------

strace -e mmap ./masim/masim hint_test_inf 2> strace.out &


sleep 2


echo 1 > /sys/kernel/mm/damon/admin/kdamonds/nr_kdamonds
echo 1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/nr_contexts

echo fvaddr > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/operations

echo 1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/nr_targets

echo $(pidof masim) >
/sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/0/pid_target

echo on > /sys/kernel/mm/damon/admin/kdamonds/0/state



start1=`cat strace.out | tail -2 | head -1 | cut -f2 -d=`

start2=`cat strace.out | tail -2 | tail -1 | cut -f2 -d=`



# convert to decimal

start1=$((${start1}))

start2=$((${start2}))



size1=`cat strace.out | tail -2 | cut -d, -f2 | head -1`

size2=`cat strace.out | tail -2 | cut -d, -f2 | tail -1`



end1=$(($start1+$size1-1))

end2=$(($start1+$size1-1))



echo $start1 $end1

echo $start2 $end2



echo 2 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/0/regions/nr_regions



echo $start1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/0/regions/0/start

echo $end1 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/0/regions/0/end



echo $start2 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/0/regions/1/start

echo $end2 > /sys/kernel/mm/damon/admin/kdamonds/0/contexts/0/targets/0/regions/1/end



perf record -e damon:damon_aggregated &



sleep 15



kill $(pidof perf)



echo off > /sys/kernel/mm/damon/admin/kdamonds/0/state



perf script



killall strace

----------- hint_test_inf -------------

#regions

# name, length

a, 1073741824 # 1 GiB

b, 1073741824 # 1 GiB



# phase 1

# name of phase

phase 1

# time in ms

9999999999999

# access patterns

# name of region, randomness, stride, probability

a, 0, 64, 99

b, 0, 64, 1



# phase 2

phase 2

# time in ms

10000

# access patterns

# name of region, randomness, stride, probability

a, 0, 64, 1

b, 0, 64, 99


Thank you!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-20  1:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19  2:49 Issue while testing new fvaddr feature Vinicius Petrucci
2022-10-19 17:45 ` SeongJae Park
2022-10-19 23:58   ` Vinicius Petrucci
2022-10-20  0:43     ` SeongJae Park
2022-10-20  1:17       ` Vinicius Petrucci

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.