Changeset 03333bc in mainline


Ignore:
Timestamp:
2010-01-23T20:08:50Z (14 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.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    ra074b4f r03333bc  
    233233}
    234234
     235static void mount_scratch(void)
     236{
     237        int rc;
     238
     239        printf("Trying to mount null/0 on /scratch... ");
     240        fflush(stdout);
     241
     242        rc = mount("tmpfs", "/scratch", "null/0", "", 0);
     243        if (rc == EOK)
     244                printf("OK\n");
     245        else
     246                printf("Failed\n");
     247}
     248
    235249static void mount_data(void)
    236250{
     
    255269                return -1;
    256270        }
     271
     272        /* Make sure tmpfs is running. */
     273        if (str_cmp(STRING(RDFMT), "tmpfs") != 0) {
     274                spawn("/srv/tmpfs");
     275        }
    257276       
    258277        spawn("/srv/devfs");
     
    263282                return -2;
    264283        }
     284
     285        mount_scratch();
    265286       
    266287        spawn("/srv/fhc");
  • 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.