summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2020-09-18 18:08:51 +0800
committer杨威 <[email protected]>2020-09-21 22:22:33 +0800
commit6a96f1d09485f93c1f14fed7d77211e50b47238e (patch)
tree30d7d0a30128ad851b302920c0b170438a36869b
parent9195a4956fce83605eadee2ae7f96ed0099fd539 (diff)
更新:test_app增加获取stream_id函数,并在testudpApp_1、testtcpApp_allpkt和testtcpApp_2输出的屏显中增加该信息
-rw-r--r--test/test_app_sapp.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/test/test_app_sapp.c b/test/test_app_sapp.c
index be43b44..7a66245 100644
--- a/test/test_app_sapp.c
+++ b/test/test_app_sapp.c
@@ -509,6 +509,21 @@ char testIPv6App_1(struct streaminfo *pstream,unsigned char routedir, int thread
return APP_STATE_GIVEME;
}
+static unsigned long long test_get_stream_id(struct streaminfo *a_stream)
+{
+ int ret = 0;
+ int device_id_size = sizeof(unsigned long long);
+ unsigned long long device_id = 0;
+
+ ret = MESA_get_stream_opt(a_stream, MSO_GLOBAL_STREAM_ID, (void *)&device_id, &device_id_size);
+ if (ret == 0)
+ {
+ return device_id;
+ }
+
+ return -1;
+}
+
static int test_udp_flow_id = -1;
char testudpApp_1(struct streaminfo *pstream,void **pme, int thread_seq,void *a_packet)
{
@@ -522,8 +537,7 @@ char testudpApp_1(struct streaminfo *pstream,void **pme, int thread_seq,void *a_
printf("'udp_flow_stat' is disable, no statistics\n");
}
}
-
- if(pstream->opstate== OP_STATE_PENDING)
+ if(pstream->opstate== OP_STATE_PENDING)
{
test_set_stream_timeout(pstream, pme, thread_seq, a_packet);
plug_stat = (struct udp_flow_stat *)malloc(sizeof(struct udp_flow_stat));
@@ -547,7 +561,7 @@ test_set_stream_timeout(pstream, pme, thread_seq, a_packet);
if(pstream->opstate==OP_STATE_CLOSE)
{
if(pdetail != NULL){
- printf("%20s: %s, ", "UdpallstreaM-inter", printaddr(&(pstream->addr), pstream->threadnum));
+ printf("%20s: %s, %llu, ", "UdpallstreaM-inter", printaddr(&(pstream->addr), pstream->threadnum), test_get_stream_id(pstream));
printf("server-pkt=%u, server-count=%lu, client-pkt=%u, client-count=%lu, datalen=%u, ",
pdetail->serverpktnum, pdetail->serverbytes,
pdetail->clientpktnum,pdetail->clientbytes, pdetail->datalen);
@@ -760,7 +774,7 @@ test_set_stream_timeout(pstream, pme, thread_seq, a_packet);
/* 2015-12-29 lijia add */
struct tcp_flow_stat *tflow_inter = ((struct tcpdetail_private *)pstream->pdetail)->flow_stat;
if(tflow_inter){
- printf("%17s: %s, ","TcpstreaM-inter", printaddr(&(pstream->addr), pstream->threadnum));
+ printf("%17s: %s, %llu,", "TcpstreaM-inter", printaddr(&(pstream->addr), pstream->threadnum), test_get_stream_id(pstream));
printf("opstate=%d, server pkt=%u, count=%lu, client pkt=%u, count=%lu\n",
pstream->opstate,
tflow_inter->C2S_data_pkt,tflow_inter->C2S_data_byte,
@@ -937,7 +951,7 @@ char testtcpApp_allpkt(struct streaminfo *pstream,void **pme, int thread_seq,voi
/* 2015-12-29 lijia add */
struct tcp_flow_stat *tflow_inter = pdetail_pr->flow_stat;
if(tflow_inter){
- printf("%20s: %s, ", "TcpallstreaM-inter", printaddr(&(pstream->addr), pstream->threadnum));
+ printf("%20s: %s, %llu", "TcpallstreaM-inter", printaddr(&(pstream->addr), pstream->threadnum), test_get_stream_id(pstream));
printf("out:%d, pktstate=%d, opstate=%d, server-pkt=%u, server-count=%lu, client-pkt=%u, client-count=%lu, ",
pdetail_pr->link_state,pstream->pktstate,pstream->opstate,
tflow_inter->C2S_all_pkt,tflow_inter->C2S_all_byte,