summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8683f8)
raw | patch | inline | side by side (parent: d8683f8)
author | vwan@ti.com <vwan@ti.com> | |
Fri, 27 Jun 2014 20:37:52 +0000 (13:37 -0700) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Tue, 5 Aug 2014 17:39:57 +0000 (10:39 -0700) |
This commit fixes an error that occurs during the recovery process when
an invalid path is used to store the contents of the remote core logs.
The -c flag can now be passed to the resource manager to specify a valid
path for the file.
This also changes a few instances where error messages were referring to
"syslink".
It addresses SDOCM00108056.
Signed-off-by: VW <vwan@ti.com>
an invalid path is used to store the contents of the remote core logs.
The -c flag can now be passed to the resource manager to specify a valid
path for the file.
This also changes a few instances where error messages were referring to
"syslink".
It addresses SDOCM00108056.
Signed-off-by: VW <vwan@ti.com>
qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/ipc.use | patch | blob | history | |
qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c | patch | blob | history |
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/ipc.use b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/ipc.use
index 60f4a8a6275e341f213acca51ef8b7820ffc5615..0652739afd76ec24cd2aa7c1b5ccfa477c6c843f 100644 (file)
ipc - IPC Resource Manager
-ipc: [-HTg] <core_id1> <executable1> [<core_id2> <executable2> ...]
+ipc: [-HTgdc] <core_id1> <executable1> [<core_id2> <executable2> ...]
<core_id#> should be set to a core name
followed by the path to the executable to load on that core.
-g Enable GateMP support on host
Supported on: DRA7xx
-d Disable automatic crash recovery
+ -c <dump_file> Generate dump of slave trace during crashes. Use
+ absolute path for filename.
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c
index 266b0f53f015dcf6c267fe2d5861561927bf7308..a76ebd6f427b0a25a5467898cdb7f2b0afafc699 100644 (file)
/* Disable recovery mechanism if true */
static int disableRecovery = false;
+static char * logFilename = NULL;
#if defined(SYSLINK_PLATFORM_VAYU)
static bool gatempEnabled = false;
for (i = 0; i < syslink_num_cores; i++) {
status = resmgr_detach(dev->dpp, dev->syslink.resmgr_id_trace[i], 0);
if (status < 0) {
- Osal_printf("syslink: resmgr_detach failed %d", errno);
+ Osal_printf("IPC: resmgr_detach failed %d", errno);
status = errno;
}
if (proc_traces[i].va && proc_traces[i].va != MAP_DEVICE_FAILED) {
status = resmgr_detach(dev->dpp, dev->syslink.resmgr_id, 0);
if (status < 0) {
- Osal_printf("syslink: resmgr_detach failed %d", errno);
+ Osal_printf("IPC: resmgr_detach failed %d", errno);
status = errno;
}
int init_devices(syslink_dev_t *dev)
{
if (init_syslink_device(dev) < 0) {
- Osal_printf("syslink: syslink device init failed");
+ Osal_printf("IPC: device init failed");
return(-1);
}
int status = EOK;
if ((status = deinit_syslink_device(dev)) < 0) {
- fprintf( stderr, "syslink: syslink device de-init failed %d\n", status);
+ fprintf( stderr, "IPC: device de-init failed %d\n", status);
status = errno;
}
int status = EOK;
uint32_t i = 0, id = 0;
+ if (logFilename) {
+ /* wait a little bit for traces to finish dumping */
+ sleep(1);
+ }
+
// Stop the remote cores right away
for (i = 0; i < MultiProc_MAXPROCESSORS; i++) {
if (procH[i]) {
}
if (recover) {
- static FILE *log;
- /* Dump the trace information */
- Osal_printf("syslink: printing remote core trace dump to"
- " /var/log/ducati-m3-traces.log");
- log = fopen ("/var/log/ducati-m3-traces.log", "a+");
- if (log) {
- for (id = 0; id < syslink_num_cores; id++) {
- if (proc_traces[id].va) {
- /* print traces */
- /* wait a little bit for traces to finish dumping */
- sleep(1);
- fprintf(log, "****************************************\n");
- fprintf(log, "*** CORE%d TRACE DUMP ***\n",
- id);
- fprintf(log, "****************************************\n");
- for (i = (*proc_traces[id].widx + 1);
- i < (proc_traces[id].len - 8);
- i++) {
- fprintf(log, "%c",
+ static FILE *log = NULL;
+ if (logFilename) {
+ /* Dump the trace information */
+ Osal_printf("IPC: printing remote core trace dump");
+ log = fopen(logFilename, "a+");
+ if (log) {
+ for (id = 0; id < syslink_num_cores; id++) {
+ if (proc_traces[id].va) {
+ /* print traces */
+ fprintf(log, "*************************************\n");
+ fprintf(log, "*** CORE%d TRACE DUMP ***\n",
+ syslink_firmware[i].proc_id);
+ fprintf(log, "*************************************\n");
+ for (i = (*proc_traces[id].widx + 1);
+ i < (proc_traces[id].len - 8);
+ i++) {
+ fprintf(log, "%c",
*(char *)((uint32_t)proc_traces[id].va + i));
- }
- for (i = 0; i < *proc_traces[id].widx; i++) {
- fprintf(log, "%c",
+ }
+ for (i = 0; i < *proc_traces[id].widx; i++) {
+ fprintf(log, "%c",
*(char *)((uint32_t)proc_traces[id].va + i));
+ }
}
}
+ fflush(log);
+ fclose(log);
+ }
+ else {
+ fprintf(stderr, "\nERROR: unable to open crash dump file %s\n",
+ logFilename);
+ exit(EXIT_FAILURE);
}
- fclose(log);
- }
- else {
- GT_setFailureReason(curTrace, GT_4CLASS, "deinit_ipc", errno,
- "error opening /var/log/ducati-m3-traces.log");
}
}
{
printf("\n\nUsage:\n");
#if defined(SYSLINK_PLATFORM_OMAP5430)
- printf("\n%s: [-HT] <core_id1> <executable1> [<core_id2> <executable2> ...]\n",
+ printf("\n%s: [-HTdc] <core_id1> <executable1> [<core_id2> <executable2> ...]\n",
app);
printf(" <core_id#> should be set to a core name (e.g. IPU, DSP)\n");
printf(" followed by the path to the executable to load on that core.\n");
printf("Options:\n");
- printf(" -H enable/disable hibernation, 1: ON, 0: OFF, Default: 1)\n");
- printf(" -T specify the hibernation timeout in ms, Default: 5000 ms)\n");
+ printf(" -H <arg> enable/disable hibernation, 1: ON, 0: OFF,"
+ " Default: 1)\n");
+ printf(" -T <arg> specify the hibernation timeout in ms, Default:"
+ " 5000 ms)\n");
#else
- printf("\n%s: [-g] <core_id1> <executable1> [<core_id2> <executable2> ...]\n",
+ printf("\n%s: [-gdc] <core_id1> <executable1> [<core_id2> <executable2> ...]\n",
app);
printf(" <core_id#> should be set to a core name (e.g. DSP1, IPU2)\n");
printf(" followed by the path to the executable to load on that core.\n");
printf("Options:\n");
- printf(" -g enable GateMP support on host\n");
+ printf(" -g enable GateMP support on host\n");
#endif
- printf(" -d disable recovery\n");
+ printf(" -d disable recovery\n");
+ printf(" -c <file> generate dump of slave trace during crashes (use\n");
+ printf(" absolute path for filename)\n");
+
exit (EXIT_SUCCESS);
}
char * abs_path = NULL;
if (-1 != stat(IPC_DEVICE_PATH, &sbuf)) {
- printf ("Syslink Already Running...\n");
+ printf ("IPC Already Running...\n");
return EXIT_FAILURE;
}
- printf ("Starting syslink resource manager...\n");
+ printf ("Starting IPC resource manager...\n");
/* Parse the input args */
while (1)
{
- c = getopt (argc, argv, "H:T:U:gdv:");
+ c = getopt (argc, argv, "H:T:U:gc:dv:");
if (c == -1)
break;
case 'd':
disableRecovery = true;
break;
+ case 'c':
+ logFilename = optarg;
+ break;
case 'v':
verbosity++;
break;
/* allocate the device structure */
if (NULL == (dev = calloc(1, sizeof(syslink_dev_t)))) {
- Osal_printf("syslink: calloc() failed");
+ Osal_printf("IPC: calloc() failed");
return (-1);
}
/* create the dispatch structure */
if (NULL == (dev->dpp = syslink_dpp = dispatch_create_channel (channelid, 0))) {
- Osal_printf("syslink: dispatch_create() failed");
+ Osal_printf("IPC: dispatch_create() failed");
return(-1);
}
/* Create the thread pool */
if ((dev->tpool = thread_pool_create(&tattr, 0)) == NULL) {
- Osal_printf("syslink: thread pool create failed");
+ Osal_printf("IPC: thread pool create failed");
return(-1);
}
/* init syslink */
status = init_ipc(dev, syslink_firmware, FALSE);
if (status < 0) {
- Osal_printf("syslink: IPC init failed");
+ Osal_printf("IPC: init failed");
return(-1);
}
/* init the syslink device */
status = init_devices(dev);
if (status < 0) {
- Osal_printf("syslink: device init failed");
+ Osal_printf("IPC: device init failed");
return(-1);
}
/* make this a daemon process */
if (-1 == procmgr_daemon(EXIT_SUCCESS,
PROCMGR_DAEMON_NOCLOSE | PROCMGR_DAEMON_NODEVNULL)) {
- Osal_printf("syslink: procmgr_daemon() failed");
+ Osal_printf("IPC: procmgr_daemon() failed");
return(-1);
}
sigaddset (&set, SIGQUIT);
sigaddset (&set, SIGTERM);
- Osal_printf("Syslink resource manager started");
+ Osal_printf("IPC resource manager started");
/* Wait for a signal */
while (1)
error = EOK;
done:
- GT_0trace(curTrace, GT_4CLASS, "Syslink resource manager exiting \n");
+ GT_0trace(curTrace, GT_4CLASS, "IPC resource manager exiting \n");
error = thread_pool_destroy(dev->tpool);
if (error < 0)
- Osal_printf("syslink: thread_pool_destroy returned an error");
+ Osal_printf("IPC: thread_pool_destroy returned an error");
deinit_ipc(dev, FALSE);
deinit_devices(dev);
free(dev);
+
return (EOK);
}