summaryrefslogtreecommitdiffstats
path: root/runtime/stpd/stpd.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-08-19 11:27:04 +0000
committerhunt <hunt>2005-08-19 11:27:04 +0000
commit4c25a38a5c14fda1d8f588d21762496f2a919746 (patch)
tree8d7e0a8e0df9ea24638a7238d68c0b236777ca73 /runtime/stpd/stpd.c
parent6a98cc8f683a59f34f2b682f4b21120930aa57da (diff)
downloadsystemtap-steved-4c25a38a5c14fda1d8f588d21762496f2a919746.tar.gz
systemtap-steved-4c25a38a5c14fda1d8f588d21762496f2a919746.tar.xz
systemtap-steved-4c25a38a5c14fda1d8f588d21762496f2a919746.zip
2005-08-19 Martin Hunt <hunt@redhat.com>
* stpd.c (main): Simplify buffer size code. * librelay.c: Major changes to support procfs instead of netlink.
Diffstat (limited to 'runtime/stpd/stpd.c')
-rw-r--r--runtime/stpd/stpd.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c
index 49b3951a..db0f328e 100644
--- a/runtime/stpd/stpd.c
+++ b/runtime/stpd/stpd.c
@@ -35,8 +35,6 @@ int print_only = 0;
int quiet = 0;
int merge = 1;
int verbose = 0;
-unsigned int opt_subbuf_size = 0;
-unsigned int opt_n_subbufs = 0;
unsigned int buffer_size = 0;
char *modname = NULL;
@@ -85,25 +83,14 @@ int main(int argc, char **argv)
break;
case 'b':
{
- char *ptr;
int size = (unsigned)atoi(optarg);
if (!size)
usage(argv[0]);
- ptr = index (optarg, 'x');
- if (ptr) {
- ptr++;
- opt_subbuf_size = (unsigned)atoi(ptr);
- printf("subbuf_size = %d\n", opt_subbuf_size);
- opt_n_subbufs = size;
- } else {
- if (size > 64) {
- fprintf(stderr, "Maximum buffer size is 64 (MB)\n");
- exit(1);
- }
- buffer_size = size * 1024 * 1024;
- opt_subbuf_size = ((size >> 2) + 1) * 65536;
- opt_n_subbufs = buffer_size / opt_subbuf_size;
+ if (size > 64) {
+ fprintf(stderr, "Maximum buffer size is 64 (MB)\n");
+ exit(1);
}
+ buffer_size = size;
break;
}
default:
@@ -114,8 +101,6 @@ int main(int argc, char **argv)
if (verbose) {
if (buffer_size)
printf ("Using a buffer of %u bytes.\n", buffer_size);
- else if (opt_n_subbufs)
- printf ("Using %u subbufs of %u bytes.\n", opt_n_subbufs, opt_subbuf_size);
}
if (optind < argc)
@@ -151,7 +136,7 @@ int main(int argc, char **argv)
sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid());
if (init_stp(stpd_filebase, !quiet)) {
- fprintf(stderr, "Couldn't initialize stpd. Exiting.\n");
+ //fprintf(stderr, "Couldn't initialize stpd. Exiting.\n");
exit(1);
}