summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4334e82)
raw | patch | inline | side by side (parent: 4334e82)
author | Chris Ring <cring@ti.com> | |
Wed, 15 Jan 2014 20:34:45 +0000 (12:34 -0800) | ||
committer | Chris Ring <cring@ti.com> | |
Tue, 8 Apr 2014 19:20:11 +0000 (12:20 -0700) |
Allow end users to enable userspace tracing via an environment
variable (IPC_DEBUG). Setting IPC_DEBUG=1 enables 'some' trace,
setting IPC_DEBUG to 2 (or 3) enables more.
This imitates a popular feature from Codec Engine, details here:
http://processors.wiki.ti.com/index.php/CE_DEBUG
variable (IPC_DEBUG). Setting IPC_DEBUG=1 enables 'some' trace,
setting IPC_DEBUG to 2 (or 3) enables more.
This imitates a popular feature from Codec Engine, details here:
http://processors.wiki.ti.com/index.php/CE_DEBUG
13 files changed:
index acf006d735d3cc47e3e1d27e3fa885de65725302..d24a6a168d0c9a04ec3e9d84e7a49b1b9e7d2a0e 100644 (file)
/*
- * Copyright (c) 2008-2013, Texas Instruments Incorporated
+ * Copyright (c) 2008-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* APIs
* =============================================================================
*/
+
+/* Internal variable to enable/disable tracing throughout MessageQ */
+extern Bool _MessageQ_verbose;
+
/*!
* @brief Function to get the default configuration for the MessageQ
* module.
index 0a23ec0792e6d4817cc87e321d5110438cc8c69c..79e0dce73e377406d46706ff807a9549e378136e 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* APIs
* =============================================================================
*/
+
+/* Internal variable to enable/disable tracing throughout NameServer */
+extern Bool _NameServer_verbose;
+
/*!
* @brief Function to setup the nameserver module.
*
index 610cc7a960c98e067dbd3bce0d74e78ff87409db..b809227ebebc95c8d7eca1744b8632f3cbfacfc6 100644 (file)
/* This is exported from daemon/GateHWSpinlockCfg_<PLATFORM>.c */
extern GateHWSpinlock_Config _GateHWSpinlock_cfgParams;
+/* Internal variable to enable/disable tracing throughout GateHWSpinlock */
+extern Bool _GateHWSpinlock_verbose;
+
#if defined (__cplusplus)
}
#endif /* defined (__cplusplus) */
index b73c78fa5d5528099f802306306b854db5fde16a..3c26db1f6deb312045381b6596b2793332c5444b 100644 (file)
--- a/linux/include/_GateMP.h
+++ b/linux/include/_GateMP.h
/*!< Resource id of GateMP proxy */
} GateMP_Object;
+/* Internal variable to enable/disable tracing throughout GateMP */
+extern Bool _GateMP_verbose;
+
/* Check GateMP has been setup */
Bool GateMP_isSetup(Void);
index 4d3a031b5782f6f7f6be244a1a3a197b88b5854a..78f741933a5f70c1be34af44220fad8a71ac8132 100644 (file)
/*
- * Copyright (c) 2008-2013, Texas Instruments Incorporated
+ * Copyright (c) 2008-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* APIs
* =============================================================================
*/
+
+/* Internal variable to enable/disable tracing throughout MultiProc */
+extern Bool _MultiProc_verbose;
+
/*!
* @brief Get the default configuration for the MultiProc module.
*
diff --git a/linux/src/api/Ipc.c b/linux/src/api/Ipc.c
index c19150b05c1b302bd64ef2e7f1f5a983c1f3e469..6dbb0b6cf622570d033405038a3e0689478c0bf2 100644 (file)
--- a/linux/src/api/Ipc.c
+++ b/linux/src/api/Ipc.c
* @brief Starts and stops user side Ipc
* All setup/destroy APIs on user side will be call from this
* module.
- *
- * @ver 0002
- *
*/
/* Standard headers */
/* Catch ctrl-C, and cleanup: */
(void) signal(SIGINT, cleanup);
+ if (getenv("IPC_DEBUG") != NULL) {
+ /* turn on tracing */
+ if (getenv("IPC_DEBUG")[0] == '1') {
+ /* level 1 enables typical user API tracing */
+ _MessageQ_verbose = TRUE;
+ _MultiProc_verbose = TRUE;
+ _NameServer_verbose = TRUE;
+#if defined(GATEMP_SUPPORT)
+ _GateMP_verbose = TRUE;
+
+ _GateHWSpinlock_verbose = TRUE;
+#endif
+ }
+ else if ((getenv("IPC_DEBUG")[0] == '2') ||
+ (getenv("IPC_DEBUG")[0] == '3')) {
+ /* levels 2 and 3 add socket and LAD client tracing */
+ _MessageQ_verbose = TRUE;
+ _MultiProc_verbose = TRUE;
+ _NameServer_verbose = TRUE;
+
+#if defined(GATEMP_SUPPORT)
+ _GateMP_verbose = TRUE;
+
+ _GateHWSpinlock_verbose = TRUE;
+#endif
+
+ /* internals - should be declared in respective _*.h files */
+ extern Bool _SocketFxns_verbose;
+ extern Bool _LAD_Client_verbose;
+
+ _SocketFxns_verbose = TRUE;
+ _LAD_Client_verbose = TRUE;
+ }
+ }
+
ladStatus = LAD_connect(&ladHandle);
if (ladStatus != LAD_SUCCESS) {
printf("Ipc_start: LAD_connect() failed: %d\n", ladStatus);
index 1911bffb52ee551f9c50823aecbe351292eb8bb3..23025c58a17850d8da022214b452db77532e6781 100644 (file)
--- a/linux/src/api/MessageQ.c
+++ b/linux/src/api/MessageQ.c
/*
* @file MessageQ.c
*
- * @brief MessageQ module "client" implementation
+ * @brief MessageQ Linux implementation
*
* This implementation is geared for use in a "client/server" model, whereby
* system-wide data is maintained in a "server" component and process-
* connects and communicates with LAD for the server connection.
*/
-
/* Standard IPC header */
#include <ti/ipc/Std.h>
-/* Linux specific header files, replacing OSAL: */
-#include <pthread.h>
-
/* Module level headers */
#include <ti/ipc/NameServer.h>
#include <ti/ipc/MultiProc.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
+#include <pthread.h>
/* Socket Protocol Family */
#include <net/rpmsg.h>
void *serverHandle;
} MessageQ_Object;
-static Bool verbose = FALSE;
+/* traces in this file are controlled via _MessageQ_verbose */
+Bool _MessageQ_verbose = FALSE;
+#define verbose _MessageQ_verbose
/* =============================================================================
index 1021ca5f0e994cc356a6700893b4ec86edd2ac10..d40cc76db8abe8be5997ca596dacd23b5e81ef88 100644 (file)
/*
- * Copyright (c) 2013, Texas Instruments Incorporated
+ * Copyright (c) 2013-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/*
* @file MultiProcQ.c
*
- * @brief Prototype Mapping of MultiProc to Socket ABI
- * (IPC 3).
+ * @brief MultiProc Linux implementation
*/
/* Standard IPC header */
#include <ti/ipc/MultiProc.h>
#include <_MultiProc.h>
-/* Socket Headers */
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
#include <ladclient.h>
#include <_lad.h>
-static Bool verbose = FALSE;
+/* traces in this file are controlled via _MultiProc_verbose */
+Bool _MultiProc_verbose = FALSE;
+#define verbose _MultiProc_verbose
/* =============================================================================
* APIS
/* Function to get default configuration for the MultiProc module.
*
*/
-
-
Void MultiProc_getConfig (MultiProc_Config * cfg)
{
Int status;
index 0c5f18f82b6e2d63cab2318c07aaa1dc4263c2f8..525dccedc53a71f2be1f711ff2a038f35d16015e 100644 (file)
#include <ladclient.h>
#include <_lad.h>
-static Bool verbose = FALSE;
-
+/* traces in this file are controlled via _NameServer_verbose */
+Bool _NameServer_verbose = FALSE;
+#define verbose _NameServer_verbose
/*
* The NameServer_*() APIs are reproduced here. These versions are just
index 65f3e62d390ba75aac868157a27ec3e32dadcf1c..3ec7e136592de064ab7b671fc2c7df107d01e234 100644 (file)
.sharedAddr = NULL
};
-static Bool verbose = FALSE;
+/* traces in this file are controlled via _GateHWSpinlock_verbose */
+Bool _GateHWSpinlock_verbose = FALSE;
+#define verbose _GateHWSpinlock_verbose
/* =============================================================================
* APIS
index 15d2fd197aa7dd0ee722b0cb453ae9da981f5723..e9d17c2b0adcd18de9a805cf57a4a3399ac5169d 100644 (file)
/* Number of remote system gates */
} GateMP_ModuleObject;
-
-static Bool verbose = FALSE;
+/* traces in this file are controlled via _GateMP_verbose */
+Bool _GateMP_verbose = FALSE;
+#define verbose _GateMP_verbose
/* Internal structure defining parameters for GateMP_Instance_init */
typedef struct {
index 6b909508a84ac60bff99b52fb18e1864a140af6e..7d6fee3cc95aa340e853935fbe3189c15917b50d 100644 (file)
/*
- * Copyright (c) 2012, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <ladclient.h>
#include <_lad.h>
-static Bool verbose = FALSE;
+
+/* traces in this file are controlled via _LAD_Client_verbose */
+Bool _LAD_Client_verbose = FALSE;
+#define verbose _LAD_Client_verbose
typedef struct _LAD_ClientInfo {
Bool connectedToLAD; /* connection status */
index 8aa9ab167d20a2e31a5e916303b98b8a3a66eb99..d41637d0daa237efba32117b18ead48982121dc8 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/* For MultiProc id to remoteproc index map */
#include <_MultiProc.h>
-static Bool verbose = FALSE;
+/* traces in this file are controlled via _SocketFxns_verbose */
+Bool _SocketFxns_verbose = FALSE;
+#define verbose _SocketFxns_verbose
int ConnectSocket(int sock, UInt16 procId, int dst)
{