mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[inc]: change LOG_TAG to MODULE_TAG for more general usage
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@38 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -53,4 +53,8 @@ typedef signed long long int RK_S64;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef MODULE_TAG
|
||||
#define MODULE_TAG "rk_mpp"
|
||||
#endif
|
||||
|
||||
#endif /*__RK_TYPE_H__*/
|
||||
|
@@ -26,20 +26,16 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef LOG_TAG
|
||||
#define LOG_TAG "rk_log"
|
||||
#endif
|
||||
|
||||
void rk_set_log_flag(RK_U32 flag);
|
||||
RK_U32 rk_get_log_flag();
|
||||
|
||||
#define rk_log(fmt, ...) _rk_log(LOG_TAG, fmt, ## __VA_ARGS__)
|
||||
#define rk_err(fmt, ...) _rk_err(LOG_TAG, fmt, ## __VA_ARGS__)
|
||||
#define rk_log(fmt, ...) _rk_log(MODULE_TAG, fmt, ## __VA_ARGS__)
|
||||
#define rk_err(fmt, ...) _rk_err(MODULE_TAG, fmt, ## __VA_ARGS__)
|
||||
|
||||
#define rk_dbg(debug, flag, fmt, ...) \
|
||||
do { \
|
||||
if (debug & flag) { \
|
||||
_rk_log(LOG_TAG, fmt, ## __VA_ARGS__); \
|
||||
_rk_log(MODULE_TAG, fmt, ## __VA_ARGS__); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
@@ -18,8 +18,9 @@
|
||||
#define __RK_MALLOC_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "rk_type.h"
|
||||
|
||||
#define rk_malloc(type, count) (type*)rk_mpp_malloc(sizeof(type) * (count))
|
||||
#define rk_malloc(type, count) (type*)rk_mpp_malloc(MODULE_TAG, sizeof(type) * (count))
|
||||
#define rk_free(ptr) rk_mpp_free(ptr)
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -27,7 +28,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void rk_mpp_show_mem_status();
|
||||
void *rk_mpp_malloc(size_t size);
|
||||
void *rk_mpp_malloc(char *tag, size_t size);
|
||||
void rk_mpp_free(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "rk_list"
|
||||
#define MODULE_TAG "rk_list"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
|
@@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "rk_malloc"
|
||||
#define MODULE_TAG "rk_malloc"
|
||||
#include "rk_type.h"
|
||||
#include "rk_log.h"
|
||||
#include "rk_env.h"
|
||||
#include "rk_malloc.h"
|
||||
#include "rk_list.h"
|
||||
|
||||
#include "os_malloc.h"
|
||||
|
||||
@@ -35,6 +36,13 @@
|
||||
#define OSAL_MEM_STUFF_EN (0x00000002)
|
||||
|
||||
static RK_S32 osal_mem_flag = -1;
|
||||
static struct list_head mem_list;
|
||||
|
||||
struct mem_node {
|
||||
struct list_head list;
|
||||
void *ptr;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
static void get_osal_mem_flag()
|
||||
{
|
||||
@@ -48,12 +56,14 @@ static void get_osal_mem_flag()
|
||||
if (val) {
|
||||
osal_mem_flag |= OSAL_MEM_STUFF_EN;
|
||||
}
|
||||
INIT_LIST_HEAD(&mem_list);
|
||||
}
|
||||
}
|
||||
|
||||
void *rk_mpp_malloc(size_t size)
|
||||
void *rk_mpp_malloc(char *tag, size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
get_osal_mem_flag();
|
||||
if (0 == os_malloc(&ptr, RK_OSAL_MEM_ALIGN, size))
|
||||
return ptr;
|
||||
else
|
||||
@@ -62,6 +72,7 @@ void *rk_mpp_malloc(size_t size)
|
||||
|
||||
void rk_mpp_free(void *ptr)
|
||||
{
|
||||
get_osal_mem_flag();
|
||||
os_free(ptr);
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "rk_env_test"
|
||||
#define MODULE_TAG "rk_env_test"
|
||||
#include "rk_env.h"
|
||||
#include "rk_log.h"
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "rk_log_test"
|
||||
#define MODULE_TAG "rk_log_test"
|
||||
#include "rk_log.h"
|
||||
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "rk_malloc_test"
|
||||
#define MODULE_TAG "rk_malloc_test"
|
||||
#include "rk_log.h"
|
||||
#include "rk_malloc.h"
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "rk_thread_test"
|
||||
#define MODULE_TAG "rk_thread_test"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
Reference in New Issue
Block a user