memstattool/0000755000000000000000000000000012237723713010323 5ustar memstattool/memstat.c0000644000000000000000000002173312237721202012136 0ustar /* * This software copyright 1997 Joshua M. Yelon. * Debian Maintainer and new Features: * copyright 1999 Bernd Eckenfels, Germany, ecki@debian.org * (see debian/changelog) * copyright 2008-2013 Michael Meskes, meskes@debian.org * * Distribution subject to the terms of the GPL. * */ #include #include #include #include #include #include #include #include #include #include /* blacklist devices that just map physical memory */ char *blacklist[] = { "/dev/mem", "/dev/dri/" }; int wide = 0; int numeric = 0; int only_pid = 0; int needinode = 0; typedef int (*qcmp) (const void *, const void *); typedef struct mapping *mapping; struct mapping { unsigned int fs, inode, pid; unsigned long offs, lo, hi; char *path; int valid; int shared; }; mapping maptab_data; size_t maptab_fill; size_t maptab_size; static void maptab_expand(void) { size_t bytes; bytes = (maptab_size * 2 + 100) * sizeof(struct mapping); maptab_data = (mapping) realloc(maptab_data, bytes); if (maptab_data == NULL) { fprintf(stderr, "Error: realloc returned null, possibly out of memory? Exiting.\n"); exit(1); } maptab_size = maptab_size * 2 + 100; } static void read_proc(void) { unsigned int nread, pid; unsigned long inode, lo, hi, offs; char *p, major[8], minor[8], buff[PATH_MAX + 300], *path, perm[4]; DIR *d; struct dirent *ent; FILE *f; mapping m; d = opendir("/proc"); if (d == 0) { perror("/proc"); exit(1); } while (1) { ent = readdir(d); if (ent == NULL) break; errno = 0; pid = strtol(ent->d_name, NULL, 10); if (errno != 0) { perror("strtol"); exit(1); } if (pid == 0 || (only_pid != 0 && pid != only_pid)) continue; sprintf(buff, "/proc/%d/maps", pid); f = fopen(buff, "r"); if (f == NULL) continue; while (fgets(buff, sizeof(buff), f)) { p = strchr(buff, '-'); if (p) *p = ' '; p = strchr(buff, ':'); if (p) *p = ' '; path = NULL; if ((strlen(buff) == 10) && (strcmp(buff, " (deleted)") == 0)) continue; nread = sscanf(buff, "%lx %lx %4s %lx %s %s %lu %ms", &lo, &hi, perm, &offs, major, minor, &inode, &path); if (nread < 7) { fprintf(stderr, "Unrecognized format of /proc/%d/maps. (nread=%d)\n", pid, nread); exit(1); } if (maptab_fill == maptab_size) maptab_expand(); m = maptab_data + maptab_fill; errno = 0; m->fs = (dev_t)(strtol(major, NULL, 16) * 256 + strtol(minor, NULL, 16)); if (errno != 0) { perror("strtol"); exit(1); } m->inode = inode; m->offs = offs; m->pid = pid; m->lo = lo; m->hi = hi; m->valid = 1; if ((nread == 8) && path && path[0]) { int i; m->path = path; for (i = 0; i < sizeof(blacklist) / sizeof(blacklist[0]); i++) { if (!strncmp(path, blacklist[i], strlen(blacklist[i]))) m->valid = 0; } } else { sprintf(buff, "[%s:%s]:%lu", major, minor, inode); m->path = strdup(buff); /* there is no file with major = minor = inode = 0 */ /* so we don't need to look for it */ if (strcmp(major,"00") || strcmp(minor,"00") || inode) needinode = 1; } /* mark segment as either shared or private */ if (perm[3] == 's' || /* declared as shared */ perm[2] == 'x') /* executables are shared */ m->shared = 1; else m->shared = 0; maptab_fill++; } fclose(f); } closedir(d); } static int sort_by_pid(mapping m1, mapping m2) { int delta; delta = m1->pid - m2->pid; return delta; } static int sort_by_inode(mapping m1, mapping m2) { int delta; delta = m1->fs - m2->fs; if (delta) return delta; delta = m1->inode - m2->inode; if (delta) return delta; delta = m1->shared - m2->shared; if (delta) return delta; delta = m1->offs - m2->offs; return delta; } static void register_path(unsigned int fs, unsigned int inode, char *path, int valid) { size_t i; mapping m; char *copy = NULL; for (i = 0; i < maptab_fill; i++) { m = maptab_data + i; if ((m->path) && (m->path[0] == '[') && (m->fs == fs) && (m->inode == inode)) { if (copy == NULL) copy = strdup(path); m->path = copy; m->valid = valid; } } } static void scan_directory(char *dir) { DIR *d; struct dirent *ent; struct stat info; int ok; char full[8192]; d = opendir(dir); if (d == NULL) return; while ((ent = readdir(d)) != NULL) { sprintf(full, "%s/%s", dir, ent->d_name); /* use lstat() here, so links do not create duplicate entries */ ok = lstat(full, &info); if (ok >= 0) { if (S_ISDIR(info.st_mode) && strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..")) /* subdirectories are scanned automatically */ scan_directory(full); else /* non-directories are stored for displaying */ register_path(info.st_dev, info.st_ino, full, S_ISREG(info.st_mode)); } } closedir(d); } static void scan_fpath(const char *fn) { char *p; FILE *f = fopen(fn, "r"); char buff[1024]; if (f == NULL) { fprintf(stderr, "Cannot open /etc/memstat.conf\n"); exit(1); } while (fgets(buff, 1023, f)) { if (buff[0] == '#') continue; p = strchr(buff, '\n'); if (p) *p = 0; scan_directory(buff); } fclose(f); } static void printline(char *str) { if (!wide && strlen(str) > 79) { str[76] = '.'; str[77] = '.'; str[78] = '.'; str[79] = 0; } printf("%s\n", str); } static void summarize_usage(void) { char buffer[8192]; unsigned int i, fs, inode, pid, scan; unsigned long offs, grand, lo = 0, hi = 0, total, sharedtotal, sharedgrand; mapping m; char *exe; grand = sharedgrand = 0; qsort(maptab_data, maptab_fill, sizeof(struct mapping), (qcmp) sort_by_pid); for (offs = 0; offs < maptab_fill; offs = scan) { char linkname[PATH_MAX], filename[PATH_MAX]; ssize_t len; int deleted = 0; pid = maptab_data[offs].pid; sprintf(filename, "/proc/%d/exe", pid); if ((len = readlink(filename, linkname, PATH_MAX)) == -1) { fprintf(stderr, "Cannot read link information for %s\n", filename); deleted = 1; } linkname[len] = '\0'; total = 0; for (scan = offs; scan < maptab_fill; scan++) { m = maptab_data + scan; if (m->pid != pid) break; /* if fs and/or inode are set, memory belongs to the process listed */ /* [vsyscall] is in kernel space */ if (!deleted && !m->fs && !m->inode && strcmp(m->path, "[vsyscall]")) total += (m->hi - m->lo); } if (!deleted) { sprintf(buffer, "%7ldk: PID %5d (%s)", total / 1024, pid, linkname); printline(buffer); grand += total; } } qsort(maptab_data, maptab_fill, sizeof(struct mapping), (qcmp) sort_by_inode); for (offs = 0; offs < maptab_fill; offs = scan) { m = maptab_data + offs; if (m->valid == 0) { scan = offs + 1; continue; } fs = m->fs; inode = m->inode; exe = m->path; if ((fs == 0) && (inode == 0)) { scan = offs + 1; continue; } sharedtotal = total = hi = 0; for (scan = offs; scan < maptab_fill; scan++) { m = maptab_data + scan; if (fs != m->fs || inode != m->inode) { /* new file */ break; } else if (m->shared) { #if 0 if (hi == 0) { /* first shared segment */ lo = m->offs; hi = m->offs + m->hi - m->lo; } else if (m->offs != lo) { /* new unconnected segment */ total += (hi - lo); lo = m->offs; hi = m->offs + m->hi - m->lo; } else if (m->offs + m->hi - m->lo > hi) { /* longer than the one we had earlier */ hi = m->offs + m->hi - m->lo; } #else if (hi == 0) { lo = m->offs; hi = m->offs + m->hi - m->lo; } else if (hi != m->offs + m->hi - m->lo) { sharedtotal += (hi - lo); lo = m->offs; hi = m->offs + m->hi - m->lo; } #endif } else total += (m->hi - m->lo); } /* do we have a segment left that hasn't been counted? */ if (hi != 0) sharedtotal += (hi - lo); sprintf(buffer, "%7ldk(%7ldk): %s", (total + sharedtotal) / 1024, sharedtotal / 1024, exe); pid = 0; for (i = offs; i < scan; i++) { m = maptab_data + i; if (m->pid != pid) { pid = m->pid; sprintf(buffer + strlen(buffer), " %d", pid); } } printline(buffer); grand += total; sharedgrand += sharedtotal; } printf("--------\n"); printf("%7ldk (%7ldk)\n", (grand + sharedgrand) / 1024, sharedgrand / 1024); } static void usage(char *prog) { fprintf(stderr, "%s 1.0\n", prog); fprintf(stderr, "usage: %s [-n] [-v] [-w] [-p pid]\n", prog); exit(1); } int main(int argc, char **argv) { char *prog = argv[0]; int opt; while ((opt = getopt(argc, argv, "nvwp:")) != -1) { switch (opt) { case 'n': numeric = 1; break; case 'v': usage(prog); break; case 'w': wide = 1; break; case 'p': only_pid = atoi(optarg); break; default: usage(prog); } } read_proc(); if (needinode && !numeric) scan_fpath("/etc/memstat.conf"); summarize_usage(); return (0); } memstattool/Makefile0000644000000000000000000000111612237722622011760 0ustar # # Makefile for memstat for Debian GNU/Linux # Copyright 1998, by Bernd Eckenfels # This file is under the GPL. # CFLAGS = -g -Wall -O2 prefix = $(DESTDIR)/ exec_prefix = $(prefix)/usr INSTALL = install INSTALL_PROGRAM = $(INSTALL) -p -s -o root -g root -m 755 INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 memstat: memstat.c clean: rm -f memstat.o memstat DEADJOE *~ */*~ install: memstat $(INSTALL_PROGRAM) memstat $(exec_prefix)/bin/memstat $(INSTALL_FILE) memstat.conf $(prefix)/etc memstattool/memstat.conf0000644000000000000000000000024412237711422012636 0ustar /dev /bin /usr/bin /usr/local/bin /usr/X11R6/bin /lib /usr/lib /usr/local/lib /usr/X11R6/lib /sbin /usr/sbin /usr/local/sbin /lib/libc5-compat /usr/lib/libc5-compatmemstattool/memstat.10000644000000000000000000000717112237712741012064 0ustar .\" This page Copyright (C) 1997 Joshua Yelon .\" Distribution subject to the terms of the GPL. .\" minor fixes by Bernd Eckenfels 1998-04-18 .\" minor fixes by Bernd Eckenfels 1998-11-01 .\" significant rewrite by Michael Meskes 2009-04-06 .TH MEMSTAT 1 "01 November 1998 " "Debian" "Linux Programmer's Manual" .SH NAME memstat \- Identify what's using up virtual memory. .SH SYNOPSIS .ft B .B memstat .RB [ "\-n" ] [ "\-v" ] [ "\-w" ] [ "\-p PID" ] .br .SH DESCRIPTION \fBmemstat\fP lists all accessible processes, executables, and shared libraries that are using up virtual memory. To get a complete list \fBmemstat\fP has to be run as root to be able to access the data of all running processes. First, the processes are listed. An amount of memory is shown along with a process ID and the name of the executable which the process is running. The amount of memory shown does not include shared memory: it only includes memory which is private to that process. So, if a process is using a shared library like libc, the memory used to hold that library is not included. The memory used to hold the executable's text-segment is also not included, since that too is shareable. After the processes, the shared objects are listed. The amount of memory is shown along with the filename of the shared object, followed by a list of the processes using the shared object. The memory is listed as the total amount of memory allocated to this object throughout the whole namespace. In brackets also the amount that is really shared is listed. Finally, a grand total is shown. Note that this program shows the amount of \fBvirtual\fP (not real) memory used by the various items. \fBmemstat\fP gets its input from the /proc filesystem. This must be compiled into your kernel and mounted for \fBmemstat\fP to work. The pathnames shown next to the shared objects are also read from /proc filesystem if this information is available. If not, \fBmemstat\fP scans the disk to translate inode information to filesnames. For this \fBmemstat\fP uses a configuration file, \fB/etc/memstat.conf\fP, to determine which directories to scan. This file should include all the major bin and lib directories in your system, as well as the /dev directory. These directories are scanned recursively, so that files stored in subdirectories are seen by \fBmemstat\fP as well. Note that this traversal of directory trees significantly increases run time. Executables or shared objects not found will be listed as ``[dev]:''. .SS Options The \fB-n\fP switch causes inode information to be printed as-is, if no file information was given and to not traverse the configured directory trees. .PP The \fB-v\fP switch prints version information and exits. .PP The \fB-w\fP switch causes a wide printout: lines are not truncated at 80 columns. .PP The \fB-p\fP switch causes \fBmemstat\fP to only print data gathered from looking at the process with the given PID. .SH NOTES These reports are intended to help identify programs that are using an excessive amount of memory, and to reduce overall memory waste. .PP .SH FILES .ta .nf /etc/memstat.conf /proc/*/maps .fi .SH "SEE ALSO" ps(1), top(1), free(1), vmstat(8), lsof(8), /usr/share/doc/memstat/memstat-tutorial.txt.gz .PP .SH BUGS \fBmemstat\fP ignores all devices that just map main memory, though this may cause \fBmemstat\fP to ignore some memory usage. Memory used by the kernel itself is not listed. .SH AUTHOR Originally written by Joshua Yelon and patched by Bernd Eckenfels . Taken over and rewritten by Michael Meskes . memstattool/memstat-tutorial.txt0000644000000000000000000001034712237711422014376 0ustar memstat is a small proc-based utility designed to help the system administrator figure out what's consuming memory. Like ps, it lists all the processes, and how much private memory each is using. Unlike ps, it also lists all the shared objects (shared libraries and executables) that are in memory, and which processes are using those shared objects. Here's a brief tutorial: Suppose you do a ps, and you see this: root 117 0.0 0.0 812 0 3 SW Sep 7 0:00 getty root 118 0.0 0.0 812 0 4 SW Sep 7 0:00 getty root 119 0.0 0.0 812 0 5 SW Sep 7 0:00 getty root 120 0.0 0.0 812 0 6 SW Sep 7 0:00 getty root 5810 0.0 0.0 812 0 1 SW 18:03 0:00 getty And you think to yourself, 812k for each copy of getty? That seems excessive! So, you generate a memstat listing, to figure out why it takes 812k to implement getty. The listing looks like this: 224k: PID 1 (/sbin/telinit) 216k: PID 9 (/sbin/update) 224k: PID 20 (/sbin/kerneld) 228k: PID 74 (/sbin/syslogd) 408k: PID 76 (/sbin/klogd) 232k: PID 82 (/usr/sbin/rpc.portmap) 224k: PID 84 (/usr/sbin/inetd) 344k: PID 87 (/usr/sbin/diald) 256k: PID 91 (/usr/sbin/diald) 236k: PID 109 (/usr/sbin/cron) 224k: PID 117 (/sbin/getty) 224k: PID 118 (/sbin/getty) 224k: PID 119 (/sbin/getty) 224k: PID 120 (/sbin/getty) 220k: PID 121 (/usr/local/sbin/hayes) 496k: PID 4595 (/usr/bin/tcsh) 224k: PID 5810 (/sbin/getty) 336k: PID 5856 (/bin/sh) 2380k: PID 5872 (/usr/X11R6/bin/XF86_SVGA) 276k: PID 5876 (/usr/X11R6/bin/fvwm) 2016k: PID 5984 (/usr/local/lib/netscape/netscape) 432k: PID 6129 (/usr/local/bin/rxvt) 460k: PID 6130 (/usr/bin/tcsh) 240k: PID 6164 (unknown) 460k: PID 6165 (/usr/bin/tcsh) 24k: /lib/ld-linux.so.1 1 9 20 74 76 82 84 87 91 109 117 118 119 120 1... 8k: /lib/libdl.so 5856 5872 5984 540k: /usr/lib/libc.so 1 9 20 74 76 82 84 87 91 109 117 118 119 120 121... 32k: /usr/lib/libm.so 5872 128k: /lib/libreadline.so.2.0 5856 224k: /usr/lib/libcurses.so 4595 5856 6130 6165 4k: /usr/local/sbin/hayes 121 52k: /usr/local/bin/rxvt 6129 8k: unknown 6164 48k: /usr/X11R6/lib/libXpm.so 5876 5984 72k: /usr/X11R6/lib/libICE.so 5984 6129 32k: /usr/X11R6/lib/libSM.so 5984 6129 628k: /usr/X11R6/lib/libX11.so 5876 5984 6129 40k: /usr/X11R6/lib/libXext.so 5876 5984 64k: /usr/X11R6/lib/libXmu.so 5984 260k: /usr/X11R6/lib/libXt.so 5984 308k: /bin/sh 5856 252k: /usr/bin/tcsh 4595 6130 6165 2608k: /usr/X11R6/bin/XF86_SVGA 5872 112k: /usr/X11R6/bin/fvwm 5876 12k: /sbin/kerneld 20 24k: /sbin/syslogd 74 20k: /sbin/klogd 76 20k: /sbin/telinit 1 4k: /sbin/update 9 12k: /sbin/getty 117 118 119 120 5810 24k: /usr/sbin/cron 109 68k: /usr/sbin/diald 87 91 16k: /usr/sbin/inetd 84 24k: /usr/sbin/rpc.portmap 82 4392k: /usr/local/lib/netscape/netscape 5984 -------- 21088k The first thing you see is these lines, which indicate that each copy of getty has allocated 224k of private data. Each getty is using a separate 224k. 224k: PID 117 (/sbin/getty) 224k: PID 118 (/sbin/getty) 224k: PID 119 (/sbin/getty) 224k: PID 120 (/sbin/getty) 224k: PID 5810 (/sbin/getty) The next thing you see is this line, which indicates that 16k is being used to hold the getty executable itself. The executable is shared among processes 117, 118, 119, 120, and 5810 (all the gettys). 16k: /sbin/getty 117 118 119 120 5810 To explain the 812k figure, you also have to look at these lines, which show that the standard C library is taking up 544k, and that the shared-library loader is taking up 28k. These two objects are being used by almost all the processes, including all the gettys: 544k: /usr/lib/libc.so 1 9 20 74 76 82 84 87 91 109 117 118 119 120 121... 28k: /lib/ld-linux.so.1 1 9 20 74 76 82 84 87 91 109 117 118 119 120 1... If you add up 16k + 224k + 544k + 28k, you get 812k. memstat is currently available in source-code form on my web-page. http://charm.cs.uiuc.edu/~jyelon/software.html - Josh memstattool/debian/0000755000000000000000000000000012237723742011547 5ustar memstattool/debian/dirs0000644000000000000000000000001412237711422012416 0ustar usr/bin etc memstattool/debian/docs0000644000000000000000000000002512237711422012407 0ustar memstat-tutorial.txt memstattool/debian/control0000644000000000000000000000072212237723655013156 0ustar Source: memstat Section: admin Priority: optional Maintainer: Michael Meskes Standards-Version: 3.9.4 Build-Depends: debhelper (>= 9) Package: memstat Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Identify what's using up virtual memory Lists all the processes, executables, and shared libraries that are using up virtual memory. It's helpful to see how the shared memory is used and which 'old' libs are loaded. memstattool/debian/changelog0000644000000000000000000001017112237723742013421 0ustar memstat (1.0) unstable; urgency=low * Updated copyright statement * Automatically scan subdirectories. * Use standard scanf option. * Added "-n" option to prevent searching for filenames. * Added "-v" option to display version information. * Bumped Standards-Version to 3.9.4, no changes needed. * Moved to debhelper 9 to get hardening automatically. -- Michael Meskes Sun, 10 Nov 2013 15:02:49 +0100 memstat (0.9) unstable; urgency=low * Set errno to 0 before running strtol so the check afterwards works, closes: #611181 * Bumped Standards-Version to 3.9.1, no changes needed. * Added source/format file. -- Michael Meskes Mon, 31 Jan 2011 12:03:33 +0100 memstat (0.8) unstable; urgency=low * Fixed handling of dev attribute. The old version failed to work under some circumstances, closes: #531757 * Re-added output of PIDs that was somehow lost, closes: #531682 -- Michael Meskes Mon, 08 Jun 2009 14:15:57 +0200 memstat (0.7) unstable; urgency=low * If a process is stopped while processing, memstat no longer stops, but instead prints out an error and continues working, closes: #531435 -- Michael Meskes Tue, 02 Jun 2009 15:13:00 +0200 memstat (0.6) unstable; urgency=low * Corrected path in reference to memstat-tutorial.txt.gz, closes: #502844 * Made program read name of executable instead of guessing it from the memory information, closes: #503026 * Added option to only show information for one process. * Do not list memory mapping devices, closes: #47260, #58290, #108510 * List all other device mappings, closes: #496778 * Count double mapped pages twice, closes: #496777 * Completely redid the whole calculation part. * Bumped Standards-Version to 3.8.1, no changes needed. -- Michael Meskes Mon, 06 Apr 2009 16:11:19 +0200 memstat (0.5) unstable; urgency=low * New maintainer, closes: #485998 * Aknowledged NMU, closes: #322749 * Fixed compiler warnings by applying patch, closes: #356024 * Fixed wrong pathname problem by applying patch, closes: #294635, #279117 * Bumped Standards-Version to 3.8.0. * Bumped debhelper compat version to 7. * Simplified rules file. -- Michael Meskes Fri, 13 Jun 2008 16:54:39 +0200 memstat (0.4.0.0.1) unstable; urgency=low * Non-maintainer upload (take two.. where did the first one go?) * Complete /usr/doc transition. Closes: #322749 -- Joey Hess Tue, 10 Jan 2006 01:28:34 -0500 memstat (0.4) unstable; urgency=high * make fscanf buffer bigger and more dynamic (Closes: Bug#5544) * less verbose postinst (Closes: Bug#97400) -- Bernd Eckenfels Fri, 12 Jul 2002 05:37:51 +0200 memstat (0.3) unstable; urgency=low * catch null pointer in reallof (Closes Bug: #108767) * new policy version (3.5.6) and use of strip/debug switches * includes Build-Depends now * lintian clean (added Priority, fixed spelling, added -isp) -- Bernd Eckenfels Thu, 23 May 2002 04:26:51 +0200 memstat (0.2) unstable; urgency=low * support for path in maps files (#23099, #31043, #49855, #50700, #22674) * added libc5 compat dirs (#34326) * started to maintain the package upstream * no compiler warnings and lintian clean (support for /usr/share) * new standards version -- Bernd Eckenfels Sat, 20 Nov 1999 18:40:23 +0100 memstat (0.1-3) unstable; urgency=low * removed double /usr/local/bin in conffile (Bug#22674) * moved man page to section 1 and meminfo -> memstat (Bug#23096) * added debian/conffiles to .deb archives control dir (Bug#27818) -- Bernd Eckenfels Sun, 1 Nov 1998 09:08:05 +0100 memstat (0.1-2) unstable; urgency=low * modified manpage to show new 'unknown' format and fix Bug#21360 -- Bernd Eckenfels Sat, 18 Apr 1998 21:58:23 +0200 memstat (0.1-1) unstable; urgency=low * changed the output from unknown files to "[]:" * Initial Release -- Bernd Eckenfels Mon, 6 Apr 1998 22:56:41 +0200 Local variables: mode: debian-changelog End: memstattool/debian/copyright0000644000000000000000000000134712237722266013507 0ustar This is Debian GNU/Linux's prepackaged version of Joshua M. Yelon's memstat, for a long time maintained upstream by Bernd Eckenfels and now maintained by Michael Meskes . This package was put together by me, Bernd Eckenfels , from the sources, which I obtained from http://charm.cs.uiuc.edu/~jyelon/software.html The debian/* Files are based on Ian Jacksons hello Package. All patches by me are subject to the GPL. Original Copyright from memstat.c: * This software copyright 1997 Joshua M. Yelon. * Distribution subject to the terms of the GPL. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. memstattool/debian/compat0000644000000000000000000000000312237723667012754 0ustar 9 memstattool/debian/rules.dh0000755000000000000000000000300412237711422013206 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/mmmm. $(MAKE) DESTDIR=$(CURDIR)/debian/memstat install # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_install dh_installman dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure memstattool/debian/manpages0000644000000000000000000000001212237711422013246 0ustar memstat.1 memstattool/debian/source/0000755000000000000000000000000012237711422013037 5ustar memstattool/debian/source/format0000644000000000000000000000000412237711422014244 0ustar 1.0 memstattool/debian/rules0000755000000000000000000000003612237723650012624 0ustar #!/usr/bin/make -f %: dh $@