madv.so.1
Usage Examples
The following examples illustrate specific aspects of the madv.so.1
shared object.
Example 4-2 Setting Advice for a Set of Applications
This configuration applies advice to all ISM segments for applications
with exec names that begin with foo
.
$ LD_PRELOAD=$LD_PRELOAD:madv.so.1 $ MADVCFGFILE=madvcfg $ export LD_PRELOAD MADVCFGFILE $ cat $MADVCFGFILE foo*:ism=access_lwp
Example 4-3 Excluding a Set of Applications From Advice
This configuration sets advice for all applications with the exception
of ls
.
$ LD_PRELOAD=$LD_PRELOAD:madv.so.1 $ MADV=access_many $ MADVCFGFILE=madvcfg $ export LD_PRELOAD MADV MADVCFGFILE $ cat $MADVCFGFILE ls:
Example 4-4 Matching a Pattern in a Configuration File
A configuration that is specified in MADVCFGFILE
takes precedence over the value set in
MADV
. Specifying *
as the
exec-name of the last configuration entry is
equivalent to setting MADV
. This example is equivalent to the
previous example.
$ LD_PRELOAD=$LD_PRELOAD:madv.so.1 $ MADVCFGFILE=madvcfg $ export LD_PRELOAD MADVCFGFILE $ cat $MADVCFGFILE ls: *:madv=access_many
Example 4-5 Setting Advice for Multiple Regions
This configuration applies one type of advice for mmap
()
regions
and different advice for heap and shared memory regions for applications whose exec
()
names begin with foo
.
$ LD_PRELOAD=$LD_PRELOAD:madv.so.1 $ MADVCFGFILE=madvcfg $ export LD_PRELOAD MADVCFGFILE $ cat $MADVCFGFILE foo*:madv=access_many,heap=sequential,shm=access_lwp