Changeset 03333bc in mainline for uspace/srv/taskmon/taskmon.c


Ignore:
Timestamp:
2010-01-23T20:08:50Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bc310a05
Parents:
a074b4f
Message:

Save dumps in files under /scratch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/taskmon/taskmon.c

    ra074b4f r03333bc  
    4848static void fault_event(ipc_callid_t callid, ipc_call_t *call)
    4949{
    50         char *argv[5];
     50        char *argv[11];
    5151        char *fname;
     52        char *dump_fname;
    5253        char *s_taskid;
     54        char **s;
    5355
    5456        task_id_t taskid;
     
    6365        }
    6466
     67        if (asprintf(&dump_fname, "/scratch/d%lld.txt", taskid) < 0) {
     68                printf("Memory allocation failed.\n");
     69                return;
     70        }
     71
    6572        printf(NAME ": Task %lld fault in thread 0x%lx.\n", taskid, thread);
    6673
    67         argv[0] = fname = "/app/taskdump";
     74        argv[0] = fname = "/app/redir";
     75        argv[1] = "-i";
     76        argv[2] = "/readme";
     77        argv[3] = "-o";
     78        argv[4] = dump_fname;
     79        argv[5] = "--";
    6880
    6981#ifdef CONFIG_VERBOSE_DUMPS
    70         argv[1] = "-m";
    71         argv[2] = "-t";
    72         argv[3] = s_taskid;
    73         argv[4] = NULL;
    74 
    75         printf(NAME ": Executing %s %s %s %s\n", argv[0], argv[1], argv[2],
    76             argv[3]);
     82        argv[6] = "/app/taskdump";
     83        argv[7] = "-m";
     84        argv[8] = "-t";
     85        argv[9] = s_taskid;
     86        argv[10] = NULL;
    7787#else
    78         argv[1] = "-t";
    79         argv[2] = s_taskid;
    80         argv[3] = NULL;
    81 
    82         printf(NAME ": Executing %s %s %s\n", argv[0], argv[1], argv[2]);
     88        argv[6] = "/app/taskdump";
     89        argv[7] = "-t";
     90        argv[8] = s_taskid;
     91        argv[9] = NULL;
    8392#endif
     93        printf(NAME ": Executing");
     94        s = argv;
     95        while (*s != NULL) {
     96                printf(" %s", *s);
     97                ++s;
     98        }
     99        putchar('\n');
    84100
    85101        if (!task_spawn(fname, argv))
Note: See TracChangeset for help on using the changeset viewer.