}
start_load() {
+ unset LATESTER_CONTROL_HACKBENCH
case $load in
none) ;;
- cpu) sshgw 'hackbench -g 3 -l 100000' & loadpid=$!;;
+ cpu) export LATESTER_CONTROL_HACKBENCH=$(sshgw 'nohup setpgid hackbench -g 3 -l 100000 >/dev/null & echo $!');;
eth) ping -f -s 60000 -q 192.168.2.3 & loadpid=$!;; # TODO: Generate eth load from another computer
can) latester -q -d can1 -i 0x7ff & loadpid=$!;;
*) error "Unknown load specification: $load"
kill_load() {
case $load in
none) ;;
- cpu) kill $loadpid; sshgw "killall -q hackbench || :";;
+ cpu) sshgw "kill -9 -$LATESTER_CONTROL_HACKBENCH; killall -q -9 hackbench || :";;
eth) kill $loadpid;;
can) kill $loadpid;;
*) error "Unknown load specification: $load"
-DPF_CAN=29 \
-DAF_CAN=PF_CAN
+
+bin_PROGRAMS += setpgid
+setpgid_SOURCES = setpgid.c
error(1, errno, "pipe fcntl");
init_ftrace();
+ if (getenv("LATESTER_CONTROL_HACKBENCH")) {
+ char cmd[1000];
+ sprintf(cmd, "ssh -x -a -S $HOME/.ssh/cangw-connection root@192.168.2.3 'kill -CONT -%s'",
+ getenv("LATESTER_CONTROL_HACKBENCH"));
+ printf("Running: %s\n", cmd);
+ system(cmd);
+ }
pthread_create(&thread, 0, measure_thread, NULL);
pthread_join(thread, NULL);
+ if (getenv("LATESTER_CONTROL_HACKBENCH")) {
+ char cmd[1000];
+ sprintf(cmd, "ssh -x -a -S $HOME/.ssh/cangw-connection root@192.168.2.3 'kill -STOP -%s'",
+ getenv("LATESTER_CONTROL_HACKBENCH"));
+ printf("Running: %s\n", cmd);
+ system(cmd);
+ }
+
close(completion_pipe[0]);
close(completion_pipe[1]);
--- /dev/null
+#define _XOPEN_SOURCE 500
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+int main(int argc, char *argv[])
+{
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s <command>\n", argv[0]);
+ return 1;
+ }
+ pid_t pid;
+ pid = atol(argv[1]);
+ if (setpgid(0, 0) != 0) {
+ perror("setpgid");
+ return 1;
+ }
+
+ char **newargv = malloc(sizeof(void*)*argc);
+ unsigned i;
+ for (i=1; i<argc; i++)
+ newargv[i-1] = argv[i];
+ newargv[argc-1] = NULL;
+ kill(0, SIGSTOP);
+ execvp(argv[1], newargv);
+ perror("execvp"); /* execve() only returns on error */
+ exit(EXIT_FAILURE);
+}