diff --git a/Platform/common/trace/trace_msg.h b/Platform/common/trace/trace_msg.h index 929994d65..f7e5be1bf 100755 --- a/Platform/common/trace/trace_msg.h +++ b/Platform/common/trace/trace_msg.h @@ -3,14 +3,20 @@ #include "trace_def.h" +typedef enum { + REPLY_OP_NO_NEED = 0x0, + REPLY_OP_NEED +} reply_op_t; + enum { TRACE_MSG_POLICY_REQ = 0x0, TRACE_MSG_POLICY_REPLY }; typedef struct _trace_hdr { - u32 ver; - u32 seq; + u32 ver; + u32 seq; + reply_op_t is_reply; } trace_hdr_t; typedef struct _trace_req { diff --git a/Platform/modules/trace-relay/trace_init.c b/Platform/modules/trace-relay/trace_init.c index 890fdb689..d399df961 100755 --- a/Platform/modules/trace-relay/trace_init.c +++ b/Platform/modules/trace-relay/trace_init.c @@ -49,6 +49,10 @@ static int trace_rcv_policy(struct sk_buff *skb, struct nlmsghdr *nlh) return 1; } + if (hdr->is_reply == REPLY_OP_NO_NEED) { + return 0; + } + reply_skb = nlmsg_new(TRACE_REPLY_SZ, GFP_KERNEL); if (reply_skb == NULL) { printk(KERN_ERR"Allocating skb memory is failure"); diff --git a/Platform/user/trace/trace-api/trace_api.c b/Platform/user/trace/trace-api/trace_api.c index a5128ad1d..ee53b750e 100755 --- a/Platform/user/trace/trace-api/trace_api.c +++ b/Platform/user/trace/trace-api/trace_api.c @@ -146,7 +146,7 @@ static void *cb_thread(void *arg) } -static trace_ret_t cfg_channel_send(const uint32_t seq, const trace_policy_t *policy) +static trace_ret_t cfg_channel_send(const uint32_t seq, const trace_policy_t *policy, const reply_op_t is_reply) { char buf[TRACE_POLICY_BUF_SZ + 10]; struct nlmsghdr *hdr = (struct nlmsghdr *)buf; @@ -306,6 +306,7 @@ static trace_ret_t __policy_async_exec(const trace_policy_t *in, void *tmp_arg; struct sysinfo info; uint32_t seq, i; + reply_op_t is_reply = REPLY_OP_NO_NEED; seq = __sync_add_and_fetch(&g_sessionid, 1); SYSLOG_DEBUG("The seq of the message is %u", seq); @@ -334,10 +335,12 @@ static trace_ret_t __policy_async_exec(const trace_policy_t *in, if (cb_arg == NULL) { SYSLOG_ERR("cbarg which is been added is failure"); goto END; - } + } + + is_reply = REPLY_OP_NEED; } - ret = cfg_channel_send(seq, in); + ret = cfg_channel_send(seq, in, is_reply); if (ret != TRACE_SUCCESS) { SYSLOG_ERR("Sending cfg is failure"); goto END;