File: capture

package info (click to toggle)
smem 0.9-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 144 kB
  • ctags: 84
  • sloc: python: 539; ansic: 81; sh: 10; makefile: 2
file content (12 lines) | stat: -rwxr-xr-x 302 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
# example of capturing target data for smem

# capture a memory data snapshot with realtime priority
mkdir -p $1
chrt --fifo 99 \
  cp -a --parents /proc/[0-9]*/{smaps,cmdline,stat} /proc/meminfo /proc/version $1

# build a compressed tarball of snapshot
cd $1/proc
tar czf ../../$1.tgz *