Changeset c47e1a8 in mainline for uspace/srv/taskmon/taskmon.c


Ignore:
Timestamp:
2010-05-21T07:50:04Z (16 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d51ee2b
Parents:
cf8cc36 (diff), 15b592b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge mainline changes (rev. 451)

File:
1 edited

Legend:

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

    rcf8cc36 rc47e1a8  
    4444#include <macros.h>
    4545#include <errno.h>
     46#include <str_error.h>
    4647
    4748#define NAME  "taskmon"
     
    4950static void fault_event(ipc_callid_t callid, ipc_call_t *call)
    5051{
    51         char *argv[11];
    52         char *fname;
     52        const char *argv[6];
     53        const char *fname;
    5354        char *dump_fname;
    5455        char *s_taskid;
    55         char **s;
     56        const char **s;
    5657
    5758        task_id_t taskid;
     
    6667        }
    6768
    68         if (asprintf(&dump_fname, "/scratch/d" PRIuTASKID ".txt", taskid) < 0) {
     69        if (asprintf(&dump_fname, "/data/core%" PRIuTASKID, taskid) < 0) {
    6970                printf("Memory allocation failed.\n");
    7071                return;
     
    7374        printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread);
    7475
    75 #ifdef CONFIG_VERBOSE_DUMPS
    76         argv[0] = "/app/redir";
    77         argv[1] = "-i";
    78         argv[2] = "/readme";
    79         argv[3] = "-o";
    80         argv[4] = dump_fname;
    81         argv[5] = "--";
    82         argv[6] = "/app/taskdump";
    83         argv[7] = "-m";
    84         argv[8] = "-t";
    85         argv[9] = s_taskid;
    86         argv[10] = NULL;
     76#ifdef CONFIG_WRITE_CORE_FILES
     77        argv[0] = "/app/taskdump";
     78        argv[1] = "-c";
     79        argv[2] = dump_fname;
     80        argv[3] = "-t";
     81        argv[4] = s_taskid;
     82        argv[5] = NULL;
    8783#else
    8884        argv[0] = "/app/taskdump";
     
    9490
    9591        printf(NAME ": Executing");
    96         s = argv;
     92       
     93        s = argv;
    9794        while (*s != NULL) {
    9895                printf(" %s", *s);
     
    10097        }
    10198        putchar('\n');
    102 
    103         if (!task_spawn(fname, argv))
    104                 printf(NAME ": Error spawning taskdump.\n", fname);
     99       
     100        int err;
     101        if (!task_spawn(fname, argv, &err))
     102                printf("%s: Error spawning %s (%s).\n", NAME, fname,
     103                    str_error(err));
    105104}
    106105
Note: See TracChangeset for help on using the changeset viewer.