summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be120b4)
raw | patch | inline | side by side (parent: be120b4)
author | Buddy Liong <a0270631@ti.com> | |
Fri, 17 Jun 2016 14:58:44 +0000 (09:58 -0500) | ||
committer | Buddy Liong <a0270631@ti.com> | |
Fri, 17 Jun 2016 15:15:50 +0000 (10:15 -0500) |
This is the initial implementation of an extensible API
that allows the user to query various remote core
parameters. Currently, there are three query parameters
that are supported:
1. CPU Load
2. Total configured heap size
3. Available heap size
The intent of this API is to programmatically call the
API and feed it in various other tools that can be
developed on top of this (for example: soc performance
visualization etc.)
NOTE: This would require a corresponding change in the
libdce as well.
Change-Id: Ie7461b9597bd8d8d6d2e9bca73c67ef9d91a6351
Signed-off-by: Karthik Ramanan <a0393906@ti.com>
Signed-off-by: Buddy Liong <a0270631@ti.com>
that allows the user to query various remote core
parameters. Currently, there are three query parameters
that are supported:
1. CPU Load
2. Total configured heap size
3. Available heap size
The intent of this API is to programmatically call the
API and feed it in various other tools that can be
developed on top of this (for example: soc performance
visualization etc.)
NOTE: This would require a corresponding change in the
libdce as well.
Change-Id: Ie7461b9597bd8d8d6d2e9bca73c67ef9d91a6351
Signed-off-by: Karthik Ramanan <a0393906@ti.com>
Signed-off-by: Buddy Liong <a0270631@ti.com>
src/ti/framework/dce/dce.c | patch | blob | history |
index 7180e9c1f13a5b2829b67f1ec460344a347db53b..e816f1ea017cd388f1efcd9c9f2456b3dc6aa253 100644 (file)
#include <xdc/runtime/IHeap.h>
#include <xdc/runtime/knl/Thread.h>
#include <xdc/std.h>
+#include <ti/sysbios/utils/Load.h>
#include "dce_priv.h"
#include "dce_rpc.h"
@@ -116,6 +117,8 @@ static VIDDEC3_Handle viddec3_create(Engine_Handle engine, String name, VIDDEC3_
static XDAS_Int32 viddec3_control(VIDDEC3_Handle codec,VIDDEC3_Cmd id,VIDDEC3_DynamicParams * dynParams,VIDDEC3_Status * status);
static XDAS_Int32 viddec3_process(VIDDEC3_Handle codec, XDM2_BufDesc *inBufs, XDM2_BufDesc *outBufs, VIDDEC3_InArgs *inArgs, VIDDEC3_OutArgs *outArgs);
+static Int32 get_rproc_info(UInt32 size, UInt32 *data);
+
static int viddec3_reloc(VIDDEC3_Handle handle, uint8_t *ptr, uint32_t len);
static Semaphore_Handle sync_process_sem;
return (0);
}
+
+#define INFO_TYPE_CPU_LOAD 0
+#define INFO_TYPE_TOTAL_HEAP_SIZE 1
+#define INFO_TYPE_AVAILABLE_HEAP_SIZE 2
+
+static Int32 get_rproc_info(UInt32 size, UInt32 *data)
+{
+ MmType_Param *payload = (MmType_Param *)data;
+ Uint32 info_type = (Uint32)payload[0].data;
+ Memory_Stats stats;
+ Uint32 output = 0;
+
+ switch(info_type)
+ {
+ case INFO_TYPE_CPU_LOAD:
+ output = Load_getCPULoad();
+ break;
+
+ case INFO_TYPE_TOTAL_HEAP_SIZE:
+ Memory_getStats(NULL, &stats);
+ output = stats.totalSize;
+ break;
+
+ case INFO_TYPE_AVAILABLE_HEAP_SIZE:
+ Memory_getStats(NULL, &stats);
+ output = stats.totalFreeSize;
+ break;
+
+ default:
+ System_printf("\n ERROR: Invalid INFO TYPE chosen \n");
+ break;
+ }
+
+ return output;
+}
+
+
+
/*
* codec_create
*/
{ "codec_control", (RcmServer_MsgFxn) codec_control },
{ "codec_get_version", (RcmServer_MsgFxn) codec_get_version },
{ "codec_process", (RcmServer_MsgFxn) codec_process },
- { "codec_delete", (RcmServer_MsgFxn) codec_delete }
+ { "codec_delete", (RcmServer_MsgFxn) codec_delete },
+ { "get_rproc_info", (RcmServer_MsgFxn) get_rproc_info }
+
};
/* DCE Server skel function table */
{ MmType_Dir_Out, MmType_Param_S32, 1 }, // return
{ MmType_Dir_In, MmType_Param_U32, 1 },
{ MmType_Dir_In, MmType_Param_U32, 1 }
+ } },
+ { "get_rproc_info", 2,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, // return
+ { MmType_Dir_In, MmType_Param_U32, 1 }
} }
+
};
static MmType_FxnSigTab dce_fxnSigTab =