mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-24 00:06:09 +00:00
overlay: Make it easier to renice
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
9bebbbc49b
commit
75ef36713a
@ -774,13 +774,13 @@ int main(int argc, char **argv)
|
||||
struct overlay_context ctx;
|
||||
struct config config;
|
||||
int index, sample_period;
|
||||
int daemonize = 1;
|
||||
int daemonize = 1, renice = 0;
|
||||
int i;
|
||||
|
||||
config_init(&config);
|
||||
|
||||
opterr = 0;
|
||||
while ((i = getopt_long(argc, argv, "c:f", long_options, &index)) != -1) {
|
||||
while ((i = getopt_long(argc, argv, "c:fn?", long_options, &index)) != -1) {
|
||||
switch (i) {
|
||||
case 'c':
|
||||
config_parse_string(&config, optarg);
|
||||
@ -797,6 +797,11 @@ int main(int argc, char **argv)
|
||||
case 'f':
|
||||
daemonize = 0;
|
||||
break;
|
||||
case 'n':
|
||||
renice = -20;
|
||||
if (optarg)
|
||||
renice = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -820,6 +825,9 @@ int main(int argc, char **argv)
|
||||
if (daemonize && daemon(0, 0))
|
||||
return EINVAL;
|
||||
|
||||
if (renice)
|
||||
nice(renice);
|
||||
|
||||
signal(SIGUSR1, signal_snapshot);
|
||||
|
||||
debugfs_init();
|
||||
|
Loading…
x
Reference in New Issue
Block a user