• Home
  • Raw
  • Download

Lines Matching full:id

127  * @tc.desc: Get, set and clear trace id
134 * @tc.steps: step1. get and validate trace id.
135 * @tc.expected: step1. trace id is invalid.
136 * @tc.steps: step2. construct trace id with chain id, span id, parent span id
138 * @tc.expected: step2. trace id is valid with same chain id, span id, parent
139 * span id and flags.
140 * @tc.steps: step3. construct invalid trace id and set into context, then get
142 * @tc.expected: step3. trace id is the same with step2.
143 * @tc.steps: step4. clear trace id, then get and validate it.
144 * @tc.expected: step4. trace id is invalid.
148 /* set thread id */
191 * @tc.desc: Interconversion between trace id and bytes array.
198 * @tc.steps: step1. get trace id and validate it.
199 * @tc.expected: step1. trace id is invalid.
200 * @tc.steps: step2. construct trace id and validate it.
201 * @tc.expected: step2. trace id is valid.
202 * @tc.steps: step3. convert trace id to bytes array.
203 * @tc.expected: step3. convert success when array size >= id length.
204 * @tc.steps: step4. convert bytes array to trace id.
205 * @tc.expected: step4. convert success only when array size == id length.
206 * @tc.steps: step5. convert invalid id to bytes array.
208 * @tc.steps: step6. convert invalid bytes array to id.
233 /* bytes to id */
245 /* set invalid id */
261 * @tc.steps: step1. start trace with flags, get trace id and validit it.
262 * @tc.expected: step1. trace id and flags is valid.
263 * @tc.steps: step2. stop trace, get trace id and validit it.
264 * @tc.expected: step2. trace id is invalid.
286 * @tc.steps: step1. start trace twice and get 2nd trace id.
288 * @tc.steps: step2. get trace id and check.
289 * @tc.expected: step2. trace id is valid and same with 1st id.
290 * @tc.steps: step3. set chain id with wrong id and get trace id.
291 * @tc.expected: step3. trace id is valid and same with 1st id.
292 * @tc.steps: step4. stop trace twice and get trace id.
293 * @tc.expected: step4. trace id is invalid.
329 /* end with invalid thread id */
347 * @tc.expected: step1. flags is same with set and span id is 0.
348 * @tc.steps: step2. create child id.
349 * @tc.expected: step2. child id has same span id with parent.
350 * @tc.steps: step3. set child id into context.
351 * @tc.steps: step4. create grand child id.
352 * @tc.expected: step4. grand child id has same span id with parent and child.
355 HiTraceId id = HiTraceChain::Begin("test", 0); variable
356 EXPECT_EQ(0, id.GetFlags());
357 EXPECT_EQ(0UL, id.GetSpanId());
358 EXPECT_EQ(0UL, id.GetParentSpanId());
363 EXPECT_EQ(childId.GetFlags(), id.GetFlags());
364 EXPECT_EQ(childId.GetChainId(), id.GetChainId());
365 EXPECT_EQ(childId.GetParentSpanId(), id.GetSpanId());
367 /* set child id to thread id */
373 EXPECT_EQ(grandChildId.GetFlags(), id.GetFlags());
374 EXPECT_EQ(grandChildId.GetChainId(), id.GetChainId());
378 HiTraceChain::End(id);
393 * @tc.steps: step2. create child id.
394 * @tc.expected: step2. child id is same with parent id.
397 HiTraceId id = HiTraceChain::Begin("test", HITRACE_FLAG_DONOT_CREATE_SPAN); variable
398 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_DONOT_CREATE_SPAN));
403 EXPECT_EQ(childId.GetFlags(), id.GetFlags());
404 EXPECT_EQ(childId.GetChainId(), id.GetChainId());
405 EXPECT_EQ(childId.GetSpanId(), id.GetSpanId());
406 EXPECT_EQ(childId.GetParentSpanId(), id.GetParentSpanId());
409 HiTraceChain::End(id);
424 * @tc.steps: step2. add trace point info with id and check logs.
431 HiTraceId id = HiTraceChain::Begin("test tp flag", HITRACE_FLAG_TP_INFO); variable
432 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_TP_INFO));
433 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 12);
435 HiTraceChain::End(id);
450 * @tc.steps: step2. add trace point info with id and check logs.
454 HiTraceId id = HiTraceChain::Begin("test no tp flag", HITRACE_FLAG_INCLUDE_ASYNC); variable
455 EXPECT_EQ(0, id.IsFlagEnabled(HITRACE_FLAG_TP_INFO));
456 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 12);
458 HiTraceChain::End(id);
473 * @tc.steps: step2. add D2D trace point info with id and check logs.
477 * @tc.steps: step3. add trace point info with id and check logs.
480 HiTraceId id = HiTraceChain::Begin("test D2D tp flag", HITRACE_FLAG_D2D_TP_INFO); variable
481 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_D2D_TP_INFO));
482 … HiTraceChain::Tracepoint(HITRACE_CM_DEVICE, HITRACE_TP_CS, id, "client send msg content %d", 12);
483 HiTraceChain::Tracepoint(HITRACE_CM_PROCESS, HITRACE_TP_CS, id, "cannot be found %d", 22);
484 HiTraceChain::Tracepoint(HITRACE_CM_THREAD, HITRACE_TP_CS, id, "cannot be found %d", 32);
485 HiTraceChain::Tracepoint(HITRACE_CM_DEFAULT, HITRACE_TP_CS, id, "cannot be found %d", 42);
490 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "cannot be found %d", 14);
492 HiTraceChain::End(id);
507 * @tc.steps: step2. add D2D trace point info with id and check logs.
510 HiTraceId id = HiTraceChain::Begin("test no D2D tp flag", HITRACE_FLAG_INCLUDE_ASYNC); variable
511 EXPECT_EQ(0, id.IsFlagEnabled(HITRACE_FLAG_D2D_TP_INFO));
512 HiTraceChain::Tracepoint(HITRACE_CM_DEVICE, HITRACE_TP_CS, id, "cannot be found %d", 12);
513 HiTraceChain::Tracepoint(HITRACE_CM_PROCESS, HITRACE_TP_CS, id, "cannot be found %d", 22);
514 HiTraceChain::Tracepoint(HITRACE_CM_THREAD, HITRACE_TP_CS, id, "cannot be found %d", 32);
515 HiTraceChain::Tracepoint(HITRACE_CM_DEFAULT, HITRACE_TP_CS, id, "cannot be found %d", 42);
517 HiTraceChain::End(id);
533 * @tc.steps: step2. add D2D trace point info with id and check logs.
535 * @tc.steps: step3. add trace point info with id and check logs.
538 …HiTraceId id = HiTraceChain::Begin("test D2D | TP tp flag", HITRACE_FLAG_D2D_TP_INFO | HITRACE_FLA… variable
539 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_D2D_TP_INFO));
540 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_TP_INFO));
541 … HiTraceChain::Tracepoint(HITRACE_CM_DEVICE, HITRACE_TP_CS, id, "client send msg content %d", 12);
542 … HiTraceChain::Tracepoint(HITRACE_CM_PROCESS, HITRACE_TP_CS, id, "client send msg content %d", 22);
543 … HiTraceChain::Tracepoint(HITRACE_CM_THREAD, HITRACE_TP_CS, id, "client send msg content %d", 32);
544 … HiTraceChain::Tracepoint(HITRACE_CM_DEFAULT, HITRACE_TP_CS, id, "client send msg content %d", 42);
546 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 13);
548 HiTraceChain::End(id);
564 * @tc.steps: step2. add D2D trace point info with id and check logs.
566 * @tc.steps: step2. add trace point info with id and check logs.
569 HiTraceId id = HiTraceChain::Begin("test no D2D, but tp flag", HITRACE_FLAG_TP_INFO); variable
570 EXPECT_EQ(0, id.IsFlagEnabled(HITRACE_FLAG_D2D_TP_INFO));
571 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_TP_INFO));
572 … HiTraceChain::Tracepoint(HITRACE_CM_DEVICE, HITRACE_TP_CS, id, "client send msg content %d", 12);
573 … HiTraceChain::Tracepoint(HITRACE_CM_PROCESS, HITRACE_TP_CS, id, "client send msg content %d", 22);
574 … HiTraceChain::Tracepoint(HITRACE_CM_THREAD, HITRACE_TP_CS, id, "client send msg content %d", 32);
575 … HiTraceChain::Tracepoint(HITRACE_CM_DEFAULT, HITRACE_TP_CS, id, "client send msg content %d", 42);
577 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 13);
579 HiTraceChain::End(id);
595 * @tc.steps: step2. add D2D trace point info with id and check logs.
597 * @tc.steps: step2. add trace point info with id and check logs.
600 HiTraceId id = HiTraceChain::Begin("test no D2D, but tp flag", HITRACE_FLAG_TP_INFO); variable
601 EXPECT_EQ(0, id.IsFlagEnabled(HITRACE_FLAG_D2D_TP_INFO));
602 EXPECT_EQ(1, id.IsFlagEnabled(HITRACE_FLAG_TP_INFO));
603 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 12);
604 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 22);
605 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 32);
606 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 42);
608 HiTraceChain::Tracepoint(HITRACE_TP_CS, id, "client send msg content %d", 13);
610 HiTraceChain::End(id);
651 * @tc.steps: step1. start trace with invalid flag and validate trace id.
652 * @tc.expected: step1. trace id is invalid.
653 * @tc.steps: step2. start trace with invalid name and validate trace id.
654 * @tc.expected: step2. trace id is valid.
677 * @tc.steps: step1. start trace with invalid flag and validate trace id.
678 * @tc.expected: step1. trace id is invalid.
679 * @tc.steps: step2. start trace with invalid name and validate trace id.
680 * @tc.expected: step2. trace id is valid.
712 HiTraceId id = HiTraceChain::Begin("test", 0); variable
713 EXPECT_EQ(0, id.GetFlags());
714 EXPECT_EQ(0UL, id.GetSpanId());
715 EXPECT_EQ(0UL, id.GetParentSpanId());
720 EXPECT_EQ(childId.GetFlags(), id.GetFlags());
721 EXPECT_EQ(childId.GetChainId(), id.GetChainId());
722 EXPECT_EQ(childId.GetParentSpanId(), id.GetSpanId());
724 /* set child id to thread id */
730 /* save child and set child id to thread id */
736 EXPECT_EQ(grandChildId.GetFlags(), id.GetFlags());
737 EXPECT_EQ(grandChildId.GetChainId(), id.GetChainId());
741 HiTraceChain::End(id);
754 * @tc.steps: step2. generate a temporary trace id.
755 * @tc.expected: step2. a trace id is generated.
756 * @tc.steps: step3. set new trace id and save old trace id.
757 * @tc.expected: step3. new trace id get into TLS.
758 * @tc.steps: step4. store old trace id.
759 * @tc.expected: step4. old trace id get into TLS.
765 HiTraceId id = HiTraceChain::Begin("RestoreTest_001", HITRACE_FLAG_TP_INFO); variable
767 // generate new trace id
779 // set new id and save old id
791 // restore old id
794 EXPECT_EQ(id.GetChainId(), currentId2.GetChainId());
795 EXPECT_EQ(id.GetSpanId(), currentId2.GetSpanId());
796 EXPECT_EQ(id.GetParentSpanId(), currentId2.GetParentSpanId());
807 HiTraceChain::End(id);
820 * @tc.steps: step2. generate a temporary trace id.
821 * @tc.expected: step2. a trace id is generated.
822 * @tc.steps: step3. set new trace id and save old trace id.
823 * @tc.expected: step3. new trace id get into TLS.
824 * @tc.steps: step4. store old trace id.
825 * @tc.expected: step4. old trace id get into TLS.
831 …HiTraceId id = HiTraceChain::Begin("RestoreTest_002", HITRACE_FLAG_TP_INFO | HITRACE_FLAG_INCLUDE_… variable
833 // generate new trace id
845 // set new id and save old id
857 // restore old id
871 HiTraceChain::End(id);
884 * @tc.steps: step2. generate a temporary trace id.
885 * @tc.expected: step2. a trace id is generated.
886 * @tc.steps: step3. set new trace id and save old trace id.
887 * @tc.expected: step3. new trace id get into TLS.
888 * @tc.steps: step4. store old trace id.
889 * @tc.expected: step4. old trace id get into TLS.
895 HiTraceId id = HiTraceChain::Begin("RestoreTest_003", HITRACE_FLAG_TP_INFO); variable
898 // generate new trace id
910 // set new id and save old id
923 // restore old id
926 EXPECT_EQ(id.GetChainId(), currentId2.GetChainId());
927 EXPECT_EQ(id.GetSpanId(), currentId2.GetSpanId());
928 EXPECT_EQ(id.GetParentSpanId(), currentId2.GetParentSpanId());
939 HiTraceChain::End(id);
952 * @tc.steps: step2. generate a temporary trace id with HITRACE_ID_INVALID flag.
953 * @tc.expected: step2. a trace id is generated.
954 * @tc.steps: step3. set new trace id and save old trace id.
955 * @tc.expected: step3. new trace id get into TLS.
956 * @tc.steps: step4. store old trace id.
957 * @tc.expected: step4. old trace id get into TLS.
963 HiTraceId id = HiTraceChain::Begin("RestoreTest_004", HITRACE_FLAG_TP_INFO); variable
965 // generate new trace id
977 // set new id and save old id
989 // restore old id
992 EXPECT_EQ(id.GetChainId(), currentId2.GetChainId());
993 EXPECT_EQ(id.GetSpanId(), currentId2.GetSpanId());
994 EXPECT_EQ(id.GetParentSpanId(), currentId2.GetParentSpanId());
1005 HiTraceChain::End(id);