summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-05-27 17:41:51 +0200
committerKay Sievers <kay.sievers@vrfy.org>2010-05-27 17:41:51 +0200
commit337d10278380ba3605f0e1e730c542ca20a817fe (patch)
tree528ca375850845865d5f1c533bb6d9b926073b94 /udev
parent87d55ff672d78ebf8afc755e88beeeb1bdf3ac5e (diff)
udevd: replace --debug-trace with --children-max
Diffstat (limited to 'udev')
-rw-r--r--udev/udevd.c43
-rw-r--r--udev/udevd.xml8
2 files changed, 23 insertions, 28 deletions
diff --git a/udev/udevd.c b/udev/udevd.c
index 5e74f6e013..189ab007a4 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -69,7 +69,6 @@ static void log_fn(struct udev *udev, int priority,
}
}
-static bool debug_trace;
static struct udev_rules *rules;
static struct udev_queue_export *udev_queue_export;
static struct udev_ctrl *udev_ctrl;
@@ -952,16 +951,15 @@ int main(int argc, char *argv[])
int fd;
FILE *f;
sigset_t mask;
- const char *value;
int daemonize = false;
int resolve_names = 1;
static const struct option options[] = {
{ "daemon", no_argument, NULL, 'd' },
- { "debug-trace", no_argument, NULL, 't' },
{ "debug", no_argument, NULL, 'D' },
+ { "children-max", required_argument, NULL, 'c' },
+ { "resolve-names", required_argument, NULL, 'N' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
- { "resolve-names", required_argument, NULL, 'N' },
{}
};
int rc = 1;
@@ -986,8 +984,8 @@ int main(int argc, char *argv[])
case 'd':
daemonize = true;
break;
- case 't':
- debug_trace = true;
+ case 'c':
+ children_max = strtoul(optarg, NULL, 10);
break;
case 'D':
debug = true;
@@ -1008,7 +1006,7 @@ int main(int argc, char *argv[])
}
break;
case 'h':
- printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--debug] "
+ printf("Usage: udevd [--help] [--daemon] [--children-max] [--debug] "
"[--resolve-names=early|late|never] [--version]\n");
goto exit;
case 'V':
@@ -1151,7 +1149,7 @@ int main(int argc, char *argv[])
}
/* redirect std{out,err} */
- if (!debug && !debug_trace) {
+ if (!debug) {
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
@@ -1175,23 +1173,22 @@ int main(int argc, char *argv[])
close(fd);
}
- /* in trace mode run one event after the other */
- if (debug_trace) {
- children_max = 1;
- } else {
- int memsize = mem_size_mb();
+ if (children_max <= 0) {
+ const char *value = getenv("UDEVD_CHILDREN_MAX");
- if (memsize > 0)
- children_max = 128 + (memsize / 8);
- else
- children_max = 128;
- }
+ if (value) {
+ children_max = strtoul(value, NULL, 10);
+ } else {
+ int memsize = mem_size_mb();
- /* possibly overwrite maximum limit of executed events */
- value = getenv("UDEVD_MAX_CHILDREN");
- if (value)
- children_max = strtoul(value, NULL, 10);
- info(udev, "initialize children_max to %u\n", children_max);
+ /* set value depending on the amount of RAM */
+ if (memsize > 0)
+ children_max = 128 + (memsize / 8);
+ else
+ children_max = 128;
+ }
+ }
+ info(udev, "set children_max to %u\n", children_max);
static_dev_create(udev);
static_dev_create_from_modules(udev);
diff --git a/udev/udevd.xml b/udev/udevd.xml
index 1f81f06535..8e7755a6ff 100644
--- a/udev/udevd.xml
+++ b/udev/udevd.xml
@@ -23,7 +23,7 @@
<cmdsynopsis>
<command>udevd</command>
<arg><option>--daemon</option></arg>
- <arg><option>--debug-trace</option></arg>
+ <arg><option>--children-max</option></arg>
<arg><option>--debug</option></arg>
<arg><option>--version</option></arg>
<arg><option>--resolve-names=early|late|never</option></arg>
@@ -48,11 +48,9 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><option>--debug-trace</option></term>
+ <term><option>--children-max</option></term>
<listitem>
- <para>Run all events completely serialized. This may be useful if udev triggers
- actions or loads kernel modules which cause problems and a slow but continuous
- operation is needed, where no events are processed in parallel.
+ <para>Limit the number of parallel executed events.
</para>
</listitem>
</varlistentry>