/* signal handling */
static void handler_sigusr1(int signo)
{
- printf("Signal %d received : parent buffer switch.\n", signo);
+ printf("LTT Signal %d received : parent buffer switch.\n", signo);
}
static void handler_sigusr2(int signo)
{
- printf("Signal %d received : parent exited.\n", signo);
+ printf("LTT Signal %d received : parent exited.\n", signo);
parent_exited = 1;
}
static void handler_sigalarm(int signo)
{
- printf("Signal %d received\n", signo);
+ printf("LTT Signal %d received\n", signo);
if(getppid() != ppid) {
/* Parent died */
- printf("Parent %lu died, cleaning up\n", ppid);
+ printf("LTT Parent %lu died, cleaning up\n", ppid);
ppid = 0;
}
alarm(3);
ppid = getppid();
- printf("ltt_usertrace_fast_daemon : init is %d, pid is %lu\n",
+ printf("LTT ltt_usertrace_fast_daemon : init is %d, pid is %lu\n",
shared_trace_info->init, getpid());
act.sa_handler = handler_sigusr1;
/* Enable signals */
ret = pthread_sigmask(SIG_SETMASK, &oldset, NULL);
if(ret) {
- printf("Error in pthread_sigmask\n");
+ printf("LTT Error in pthread_sigmask\n");
}
alarm(3);
while(1) {
- sleep(1);
pause();
if(ppid == 0) break; /* parent died */
if(parent_exited) break;
- printf("Doing a buffer switch read. pid is : %lu\n", getpid());
+ printf("LTT Doing a buffer switch read. pid is : %lu\n", getpid());
//printf("Test parent. pid is : %lu, ppid is %lu\n", getpid(), getppid());
}
/* Disable signals */
ret = sigfillset(&set);
if(ret) {
- printf("Error in sigfillset\n");
+ printf("LTT Error in sigfillset\n");
}
ret = pthread_sigmask(SIG_BLOCK, &set, &oldset);
if(ret) {
- printf("Error in pthread_sigmask\n");
+ printf("LTT Error in pthread_sigmask\n");
}
pid = fork();
/* Enable signals */
ret = pthread_sigmask(SIG_SETMASK, &oldset, NULL);
if(ret) {
- printf("Error in pthread_sigmask\n");
+ printf("LTT Error in pthread_sigmask\n");
}
} else if(pid == 0) {
/* Child */
exit(-1);
} else if(pid < 0) {
/* fork error */
- perror("Error in forking ltt-usertrace-fast");
+ perror("LTT Error in forking ltt-usertrace-fast");
}
}