Mod aaa-12 add debug syslog

RCA:
SOL:
修改人:zhangtao
检视人:zhangtao
This commit is contained in:
zhangtaohz 2019-06-20 15:52:24 +08:00
parent 27b6d69578
commit 7effa0bcdd
2 changed files with 10 additions and 2 deletions

View File

@ -82,6 +82,7 @@ static int trace_rcv_policy(struct sk_buff *skb, struct nlmsghdr *nlh)
} }
if (hdr->is_reply == REPLY_OP_NO_NEED) { if (hdr->is_reply == REPLY_OP_NO_NEED) {
printk(KERN_DEBUG"Not need reply");
return 0; return 0;
} }

View File

@ -58,7 +58,7 @@ typedef struct _sess {
static int g_pid; static int g_pid;
static pthread_t g_client_thread; static pthread_t g_client_thread;
static volatile int g_client_stop = 0; static volatile int g_client_stop = 0;
static uint32_t g_sessionid = 0; static uint32_t g_seq = 0;
static volatile sess_t g_sess = {0}; static volatile sess_t g_sess = {0};
static int g_channel_open = -1; static int g_channel_open = -1;
@ -163,6 +163,13 @@ static trace_ret_t cfg_channel_send(const uint32_t seq, const trace_policy_t *p
commnl_addattr_l(hdr, sizeof(buf), TRACE_MSG_POLICY_REQ, &req, sizeof(trace_req_t)); commnl_addattr_l(hdr, sizeof(buf), TRACE_MSG_POLICY_REQ, &req, sizeof(trace_req_t));
SYSLOG_DEBUG("Send msg len:%u, msg_flag:%u, msg_type:%u", hdr->nlmsg_len, hdr->nlmsg_flags, hdr->nlmsg_type); SYSLOG_DEBUG("Send msg len:%u, msg_flag:%u, msg_type:%u", hdr->nlmsg_len, hdr->nlmsg_flags, hdr->nlmsg_type);
SYSLOG_DEBUG("Send hdr: is_reply:%d, seq:%u, ver:%u", req.hdr.is_reply, req.hdr.seq, req.hdr.ver);
SYSLOG_DEBUG("Send policy:");
SYSLOG_DEBUG(" src family:%u, src ip:%02x, sport:%u",
req.policy.src.family, req.policy.src.addr.ip4, req.policy.sport);
SYSLOG_DEBUG(" dst family:%u, dst ip:%02x, dport:%u",
req.policy.dst.family, req.policy.dst.addr.ip4, req.policy.dport);
SYSLOG_DEBUG(" protocol:%u, app_type:%u", req.policy.protocol, req.policy.app_type);
/*发送组装好的netlink消息*/ /*发送组装好的netlink消息*/
if (commcfg_send(hdr) < 0) { if (commcfg_send(hdr) < 0) {
@ -309,7 +316,7 @@ static trace_ret_t __trace_async_exec(const trace_policy_t *in,
uint32_t seq, i; uint32_t seq, i;
reply_op_t is_reply = REPLY_OP_NO_NEED; reply_op_t is_reply = REPLY_OP_NO_NEED;
seq = __sync_add_and_fetch(&g_sessionid, 1); seq = __sync_add_and_fetch(&g_seq, 1);
SYSLOG_DEBUG("The seq of the message is %u", seq); SYSLOG_DEBUG("The seq of the message is %u", seq);
cb_arg_t *cb_arg = NULL; cb_arg_t *cb_arg = NULL;