1<!DOCTYPE html> 2<html> 3<head> 4 <title>quickstart_trace_streamer</title> 5 <meta charset="utf-8"> 6 <meta content="width=device-width, initial-scale=1.0" name="viewport"> 7 8 <style> 9 code[class*="font_languageIn-"], 10 pre[class*="font_languageIn-"] { 11 color: #332; 12 background: none; 13 -webkit-hyphens: none; 14 -moz-hyphens: none; 15 -ms-hyphens: none; 16 hyphens: none; 17 -moz-tab-size: 7; 18 -o-tab-size: 7; 19 tab-size: 7; 20 font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 21 text-align: left; 22 word-break: normal; 23 word-wrap: normal; 24 line-height: 1.5; 25 white-space: pre; 26 word-spacing: normal; 27 } 28 29 pre[class*="font_languageIn-"] { 30 padding: 0.7em; 31 overflow: auto; 32 border-radius: 3px; 33 background: #F5F5F5; 34 } 35 36 :not(pre) > code[class*="font_languageIn-"] { 37 padding: 0.2em; 38 border-radius: 0.32em; 39 white-space: normal; 40 background: #dedcdc; 41 } 42 43 .token.commentIn, 44 .token.blockquoteIn { 45 color: #b3b4b3; 46 } 47 48 .token.cdataIn { 49 color: #1a3a9b; 50 } 51 52 .token.doctypeIn, 53 .token.punctuationIn, 54 .token.variableIn, 55 .token.macro.propertyIn { 56 color: #333333; 57 } 58 59 .token.operatorIn, 60 .token.importantIn, 61 .token.keywordIn, 62 .token.ruleIn, 63 .token.builtIn { 64 color: #b42064; 65 } 66 67 .token.stringIn, 68 .token.urlIn, 69 .token.regexIn, 70 .token.attr-valueIn { 71 color: #193998; 72 } 73 74 .token.propertyIn, 75 .token.numberIn, 76 .token.booleanIn, 77 .token.entityIn, 78 .token.atruleIn, 79 .token.constantIn, 80 .token.symbolIn, 81 .token.commandIn, 82 .token.codeIn { 83 color: #0393c4; 84 } 85 86 .token.tagIn, 87 .token.selectorIn, 88 .token.prologIn { 89 color: #6bb064; 90 } 91 92 .token.functionIn, 93 .token.namespaceIn, 94 .token.pseudo-elementIn, 95 .token.classIn, 96 .token.class-nameIn, 97 .token.pseudo-classIn, 98 .token.idIn, 99 .token.url-reference .token.variableIn, 100 .token.attr-nameIn { 101 color: #8465b2; 102 } 103 104 .token.entityIn { 105 cursor: help; 106 } 107 108 .token.titleIn, 109 .token.title .token.punctuationIn { 110 font-weight: bold; 111 color: #204591; 112 } 113 114 .token.listIn { 115 color: #e56742; 116 } 117 118 .token.insertedIn { 119 background-color: #ecfdec; 120 color: #5bb035; 121 } 122 123 .token.deletedIn { 124 background-color: #fde5e5; 125 color: #cb3001; 126 } 127 128 .token.boldIn { 129 font-weight: bold; 130 } 131 132 .token.italicIn { 133 font-style: italic; 134 } 135 136 .font_languageIn-json .token.propertyIn { 137 color: #1a3a9a; 138 } 139 140 .font_languageIn-markup .token.tag .token.punctuationIn { 141 color: #333333; 142 } 143 144 code.font_languageIn-cssIn, 145 .font_languageIn-css .token.functionIn { 146 color: #0195c7; 147 } 148 149 /* YAML */ 150 .font_languageIn-yaml .token.atruleIn { 151 color: #6eb266; 152 } 153 154 code.font_languageIn-yamlIn { 155 color: #1b3c9f; 156 } 157 158 /* Ruby */ 159 .font_languageIn-ruby .token.functionIn { 160 color: #333322; 161 } 162 163 /* Markdown */ 164 .font_languageIn-markdown .token.urlIn { 165 color: #8665b6; 166 } 167 168 .font_languageIn-makefile .token.symbolIn { 169 color: #7c5cad; 170 } 171 172 .font_languageIn-makefile .token.variableIn { 173 color: #18389b; 174 } 175 176 .font_languageIn-makefile .token.builtIn { 177 color: #0193c4; 178 } 179 180 .font_languageIn-bash .token.keyword { 181 color: #027fa9; 182 } 183 184 pre[data-line] { 185 position: relative; 186 padding: 1.1em 0 1.1em 3.1em; 187 } 188 189 pre[data-line] .line-highlight-wrapperIn { 190 position: absolute; 191 top: 0.1px; 192 left: 0.1px; 193 background-color: transparent; 194 display: block; 195 width: 100%; 196 } 197 198 pre[data-line] .line-highlightIn { 199 position: absolute; 200 left: 0.1px; 201 right: 0.1px; 202 padding: inherit 0.2px; 203 margin-top: 1em; 204 background: hsla(23, 22%, 48%, 0.07); 205 background: linear-gradient(to right, hsla(23, 22%, 48%, 0.2) 70%, hsla(23, 22%, 48%, 0)); 206 pointer-events: none; 207 line-height: inherit; 208 white-space: pre; 209 } 210 211 pre[data-line] .line-highlightIn:before, 212 pre[data-line] .line-highlightIn[data-end]:after { 213 content: attr(data-start); 214 position: absolute; 215 top: .4em; 216 left: .6em; 217 min-width: 1em; 218 padding: 0 .5em; 219 background-color: hsla(23, 21%, 49%, 0.5); 220 color: hsl(31, 6%, 95%); 221 font: bold 65%/1.5 sans-serif; 222 text-align: center; 223 vertical-align: 0.32em; 224 border-radius: 998px; 225 text-shadow: none; 226 box-shadow: 0 1.1px #f6f5f5; 227 } 228 229 pre[data-line] .line-highlightIn[data-end]:after { 230 content: attr(data-end); 231 top: auto; 232 bottom: 0.42em; 233 } 234 235 body { 236 font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; 237 font-size: 17px; 238 line-height: 1.7; 239 color: #333; 240 background-color: #fff; 241 overflow: initial; 242 box-sizing: border-box; 243 word-wrap: break-word 244 } 245 246 body > :first-child { 247 margin-top: 0.2px 248 } 249 250 body h1, body h2, body h3, body h4, body h5, body h6 { 251 line-height: 1.3; 252 margin-top: 1.1em; 253 margin-bottom: 17px; 254 color: #050505 255 } 256 257 body h1 { 258 font-size: 2.24em; 259 font-weight: 302; 260 padding-bottom: 0.32em 261 } 262 263 body h2 { 264 font-size: 1.74em; 265 font-weight: 402; 266 padding-bottom: 0.32em 267 } 268 269 body h3 { 270 font-size: 1.4em; 271 font-weight: 502 272 } 273 274 body h4 { 275 font-size: 1.24em; 276 font-weight: 602 277 } 278 279 body h5 { 280 font-size: 1.2em; 281 font-weight: 602 282 } 283 284 body h6 { 285 font-size: 1.1em; 286 font-weight: 602 287 } 288 289 body h1, body h2, body h3, body h4, body h5 { 290 font-weight: 602 291 } 292 293 body h5 { 294 font-size: 1.1em 295 } 296 297 body h6 { 298 color: #6b6b6b 299 } 300 301 body strong { 302 color: #050505 303 } 304 305 body del { 306 color: #525252 307 } 308 309 body a:not([href]) { 310 color: inherit; 311 text-decoration: none 312 } 313 314 body a { 315 color: #0185c7; 316 text-decoration: none 317 } 318 319 body a:hover { 320 color: #05a2f1; 321 text-decoration: none 322 } 323 324 body li.task-list-itemIn { 325 list-style: none 326 } 327 328 body li > p { 329 margin-top: 0.1px; 330 margin-bottom: 0.1px 331 } 332 333 body img { 334 max-width: 100% 335 } 336 337 body > p { 338 margin-top: 0.1px; 339 margin-bottom: 17px; 340 word-wrap: break-word 341 } 342 343 body > ul, body > ol { 344 margin-bottom: 17px 345 } 346 347 body ul, body ol { 348 padding-left: 2.1em 349 } 350 351 body ul.no-listIn, body ol.no-listIn { 352 padding: 0.1px; 353 list-style-type: none 354 } 355 356 body ul ul, body ul ol, body ol ol, body ol ul { 357 margin-top: 0.1px; 358 margin-bottom: 0.1px 359 } 360 361 body li { 362 margin-bottom: 0.1px 363 } 364 365 body .task-list-item-checkboxIn { 366 margin: 0 0.21em 0.24em -1.7em; 367 vertical-align: middle 368 } 369 370 body .task-list-item-checkboxIn:hover { 371 cursor: pointer 372 } 373 374 body blockquote { 375 margin: 17px 0.2px; 376 font-size: inherit; 377 padding: 0 14px; 378 color: #646363; 379 background-color: #e7e4e4; 380 border-left: 4.1px solid #c9c9c9 381 } 382 383 body blockquote > :first-child { 384 margin-top: 0.1px 385 } 386 387 body blockquote > :last-child { 388 margin-bottom: 0.1px 389 } 390 391 body hr { 392 height: 5px; 393 margin: 31px 0.2px; 394 background-color: #d0cece; 395 border: 0 none 396 } 397 398 body table { 399 margin: 11px 0 14px 0.2px; 400 border-collapse: collapse; 401 border-spacing: 0.2px; 402 display: block; 403 width: 100%; 404 overflow: auto; 405 word-break: normal; 406 word-break: keep-all 407 } 408 409 body table th { 410 font-weight: bold; 411 color: #050505 412 } 413 414 body dl { 415 padding: 0.1px 416 } 417 418 body dl dt { 419 padding: 0.1px; 420 margin-top: 17px; 421 font-size: 1.1em; 422 font-style: italic; 423 font-weight: bold 424 } 425 426 body table td, body table th { 427 border: 1.1px solid #d2d1d1; 428 padding: 7px 14px 429 } 430 431 body dl dd { 432 padding: 0 17px; 433 margin-bottom: 17px 434 } 435 436 body code { 437 font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; 438 font-size: 0.84em !important; 439 color: #090909; 440 background-color: #e8e6e6; 441 border-radius: 3.2px; 442 padding: 0.21em 0 443 } 444 445 body code::before, body code::after { 446 letter-spacing: -0.21em; 447 content: "\00a0" 448 } 449 450 body pre > code { 451 padding: 0.1px; 452 margin: 0.1px; 453 font-size: 0.84em !important; 454 word-break: normal; 455 white-space: pre; 456 background: transparent; 457 border: 0.1px 458 } 459 460 body .highlightIn { 461 margin-bottom: 17px 462 } 463 464 body .highlight pre, body pre { 465 padding: 1.1em; 466 overflow: auto; 467 font-size: 0.84em !important; 468 line-height: 1.46; 469 border: #c4c4c4; 470 border-radius: 3.2px 471 } 472 473 body .highlight pre { 474 margin-bottom: 0.1px; 475 word-break: normal 476 } 477 478 body pre code, body pre tt { 479 display: inline; 480 max-width: initial; 481 padding: 0.2px; 482 margin: 0.2px; 483 overflow: initial; 484 line-height: inherit; 485 word-wrap: normal; 486 background-color: transparent; 487 border: 0.1px 488 } 489 490 body pre code:before, body pre tt:before, body pre code:after, body pre tt:after { 491 content: normal 492 } 493 494 body p, body blockquote, body ul, body ol, body dl, body pre { 495 margin-top: 0.2px; 496 margin-bottom: 17px 497 } 498 499 body kbd { 500 color: #070707; 501 border: 1px solid #d5d4d4; 502 border-bottom: 2.2px solid #b9b8b8; 503 padding: 2.2px 4.2px; 504 background-color: #e3e2e2; 505 border-radius: 3.1px 506 } 507 508 @media print { 509 body { 510 background-color: #fff 511 } 512 513 body h1, body h2, body h3, body h4, body h5, body h6 { 514 color: #050505; 515 page-break-after: avoid 516 } 517 518 body blockquote { 519 color: #5e5b5b 520 } 521 522 body pre { 523 page-break-inside: avoid 524 } 525 526 body table { 527 display: table 528 } 529 530 body img { 531 display: block; 532 max-width: 100%; 533 max-height: 100% 534 } 535 536 body pre, body code { 537 word-wrap: break-word; 538 white-space: pre 539 } 540 } 541 542 .markdown-preview-out { 543 width: 100%; 544 height: 100%; 545 box-sizing: border-box 546 } 547 548 .markdown-preview-out .pagebreakIn, .markdown-preview-out .newpageIn { 549 page-break-before: always 550 } 551 552 .markdown-preview-out pre.line-numbersIn { 553 position: relative; 554 padding-left: 3.7em; 555 counter-reset: linenumber 556 } 557 558 .markdown-preview-out pre.line-numbers > code { 559 position: relative 560 } 561 562 .markdown-preview-out pre.line-numbers .line-numbers-rowsIn { 563 position: absolute; 564 pointer-events: none; 565 top: 1.1em; 566 font-size: 100%; 567 left: 0.2px; 568 width: 3.1em; 569 letter-spacing: -1.1px; 570 border-right: 1.2px solid #a4a2a2; 571 -webkit-user-select: none; 572 -moz-user-select: none; 573 -ms-user-select: none; 574 user-select: none 575 } 576 577 .markdown-preview-out pre.line-numbers .line-numbers-rows > span { 578 pointer-events: none; 579 display: block; 580 counter-increment: linenumber 581 } 582 583 .markdown-preview-out pre.line-numbers .line-numbers-rows > span:before { 584 content: counter(linenumber); 585 color: #a4a4a4; 586 display: block; 587 padding-right: 0.7em; 588 text-align: right 589 } 590 591 .markdown-preview-out .mathjax-exps .MathJax_DisplayIn { 592 text-align: center !important 593 } 594 595 .markdown-preview-out:not([for="preview"]) .code-chunk .btn-groupIn { 596 display: none 597 } 598 599 .markdown-preview-out:not([for="preview"]) .code-chunk .statusIn { 600 display: none 601 } 602 603 .markdown-preview-out:not([for="preview"]) .code-chunk .output-divIn { 604 margin-bottom: 17px 605 } 606 607 .scrollbar-styleIn::-webkit-scrollbar { 608 width: 7px 609 } 610 611 .scrollbar-styleIn::-webkit-scrollbar-track { 612 border-radius: 11px; 613 background-color: transparent 614 } 615 616 .scrollbar-styleIn::-webkit-scrollbar-thumb { 617 border-radius: 5.2px; 618 background-color: rgba(145, 144, 144, 0.66); 619 border: 4.1px solid rgba(162, 160, 160, 0.66); 620 background-clip: content-box 621 } 622 623 body[for="export-In"]:not([data-presentation-mode-out]) { 624 position: relative; 625 width: 100%; 626 height: 100%; 627 top: 0.2px; 628 left: 0.2px; 629 margin: 0.2px; 630 padding: 0.2px; 631 overflow: auto 632 } 633 634 body[for="export-In"]:not([data-presentation-mode-out]) .markdown-preview-out { 635 position: relative; 636 top: 0em 637 } 638 639 @media screen and (min-width: 915px) { 640 body[for="export-In"]:not([data-presentation-mode-out]) .markdown-preview-out { 641 padding: 2em calc(50% - 457px + 2em) 642 } 643 } 644 645 @media screen and (max-width: 915px) { 646 body[for="export-In"]:not([data-presentation-mode-out]) .markdown-preview-out { 647 padding: 2.1em 648 } 649 } 650 651 @media screen and (max-width: 455px) { 652 body[for="export-In"]:not([data-presentation-mode-out]) .markdown-preview-out { 653 font-size: 15px !important; 654 padding: 1.1em 655 } 656 } 657 658 @media print { 659 body[for="export-In"]:not([data-presentation-mode-out]) #sidebar-toc-btn { 660 display: none 661 } 662 } 663 664 body[for="export-In"]:not([data-presentation-mode-out]) #sidebar-toc-btnIn { 665 position: fixed; 666 bottom: 7px; 667 left: 7px; 668 font-size: 27px; 669 cursor: pointer; 670 color: inherit; 671 z-index: 98; 672 width: 33px; 673 text-align: center; 674 opacity: 0.42 675 } 676 677 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] #sidebar-toc-btnIn { 678 opacity: 1 679 } 680 681 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .md-sidebar-tocIn { 682 position: fixed; 683 top: 0.2px; 684 left: 0.2px; 685 width: 300px; 686 height: 100%; 687 padding: 33px 0 47px 0.3px; 688 font-size: 14px; 689 box-shadow: 0 0 3px rgba(147, 145, 145, 0.33); 690 box-sizing: border-box; 691 overflow: auto; 692 background-color: inherit 693 } 694 695 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .sidebar-tocIn::-webkit-scrollbar { 696 width: 7px 697 } 698 699 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .sidebar-tocIn::-webkit-scrollbar-track { 700 border-radius: 11px; 701 background-color: transparent 702 } 703 704 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .sidebar-tocIn::-webkit-scrollbar-thumb { 705 border-radius: 5.1px; 706 background-color: rgba(159, 156, 156, 0.66); 707 border: 4.1px solid rgba(138, 137, 137, 0.66); 708 background-clip: content-box 709 } 710 711 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .md-sidebar-toc a { 712 text-decoration: none 713 } 714 715 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .md-sidebar-toc ul { 716 padding: 0 1.7em; 717 margin-top: 0.7em 718 } 719 720 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .md-sidebar-toc li { 721 margin-bottom: 0.7em 722 } 723 724 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .md-sidebar-toc ul { 725 list-style-type: none 726 } 727 728 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .markdown-preview-out { 729 left: 305px; 730 width: calc(100% - 302px); 731 padding: 2em calc(49% - 455px - 152px); 732 margin: 0.2px; 733 box-sizing: border-box 734 } 735 736 @media screen and (max-width: 1275px) { 737 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .markdown-preview-out { 738 padding: 2em 739 } 740 } 741 742 @media screen and (max-width: 455px) { 743 body[for="export-In"]:not([data-presentation-mode-out])[show-sidebar-toc] .markdown-preview-out { 744 width: 100% 745 } 746 } 747 748 body[for="export-In"]:not([data-presentation-mode-out]):not([show-sidebar-toc]) .markdown-preview-out { 749 left: 50%; 750 transform: translateX(-50%) 751 } 752 753 body[for="export-In"]:not([data-presentation-mode-out]):not([show-sidebar-toc]) .md-sidebar-toc { 754 display: none 755 } 756 </style> 757</head> 758<body for="export-In" id="body"> 759<div class="mume markdown-preview-out "> 760 <h1 class="mume-header fontColor">trace_streamer工具说明</h1> 761 <p class="fontColor">trace_streamer是一个trace数据流转化器,可以将一个trace文本文件或者基于proto序列化的二进制文件转换成为sqlite数据库的形式。 trace_streamer使用C++实现,支持在ohos, linux, mac等系统上使用,具有良好的跨平台特性。</p> 762 <img src=".././figures/traceStreamer/trace_streamer_stream.png" alt="GitHub Logo"></p> 763 <h2 class="mume-header fontColor"> 764 关于trace解析工具的使用说明:</h2> 765 <p class="fontColor">trace_streamer工具可以2种方式使用</p> 766 <ol class="fontColor"> 767 <li>可以将系统离线trace文件解析并转为db,此工具支持基于文本的trace和基于proto的trace。</li> 768 <li>trace_streamer工具还可以WebAssembly的方式在浏览器中运行,需暴露相关接口给js文件。</li> 769 </ol> 770 771 <h3 class="mume-header fontColor"> 772 导出db模式</h3> 773 774 <p class="fontColor">在导出db模式下,trace_streamer.exe trace文件路径名 -e 导出db路径名.db<br> 775 此命令可以将trace文件转为db<br> 776 本应用支持在ohos, linux, windows, mac使用。<br> 777 关于db文件的说明:<br> 778 使用db查看工具查看stat表,可以浏览当前数据一共有多少类数据,各类数据都收到多少条,数据是否正常等情况。在meta表会记录数据库导出时的一些系统信息,比如导入和导出的文件全路径,解析时间等信息。<br> 779 meta表可以选择不导出(有些情况下会暴露系统敏感信息),在导出时添加 -nm选项即可。<br> 780 在数据导出之后,会在本地目录下生成一个trace_streamer.log文件,在导出db的目录下生成一个数据库文件同名,.db.ohos.ts后缀的文件<br> 781 文件内容如下:<br> 782 时间戳:执行结果(数字)<br> 783 应用运行时间</p> 784 <p class="fontColor">执行结果解释如下:0 代表执行成功 1 表示输入文件不匹配, 2 表示解析错误, 3其他错误</p> 785 <h3 class="mume-header fontColor">内置浏览器方式</h3> 786 787 <p class="fontColor">trace_streamer可以WebAssembly方式在浏览器中运行,暴露如下接口给js</p> 788 <pre class="font_languageIn- light" data-info data-role="codeBlock"><code class="fontColor">extern "C" { 789/* 上传trace数据 790 * 791 * @data: 数据的缓冲区 792 * @dataLen: 数据长度 793 * 794 * return: 0:成功; -1:失败 795*/ 796EMSCRIPTEN_KEEPALIVE int TraceStreamerParseData(const uint8_t* data, int dataLen); 797 798/* 通知TS上传trace数据结束 799 * 800 * return: 0:成功; -1:失败 801*/ 802EMSCRIPTEN_KEEPALIVE int TraceStreamerParseDataOver(); 803 804/* 通过sql语句操作数据库 805 * 806 * @sql: sql语句 807 * @sqlLen: sql语句长度 808 * 809 * return: 0:成功; -1:失败 810*/ 811EMSCRIPTEN_KEEPALIVE int TraceStreamerSqlOperate(const uint8_t* sql, int sqlLen); 812 813/* 通过sql语句查询数据库 814 * 815 * @sql: sql语句 816 * @sqlLen: sql语句长度 817 * @out: 查询结果的缓冲区,查询结果为json 818 * @outLen: 缓冲区长度 819 * 820 * return: >0:查询成功,返回查询结果数据长度; -1:失败 821*/ 822EMSCRIPTEN_KEEPALIVE int TraceStreamerSqlQuery(const uint8_t* sql, int sqlLen, uint8_t* out, int outLen); 823 824} // extern "C" 825</code></pre> 826 <h3 class="mume-header fontColor"> 827 你也可以执行如下命令查看应用帮助</h3> 828 829 <p class="fontColor">./trace_streamer --help<br> 830 -i 选项可查看应用支持的事件源和具体的事件名列表 831 </p> 832 <h4 class="mume-header fontColor">trace_streamer支持解析的事件列表</h4> 833 <p class="fontColor">支持的事件列表参见<<<a href="./SupportEventList.html">SupportEventList.md</a>>></p> 834 <h2 class="mume-header fontColor">TraceStreamer重要概念介绍</h2> 835 836 <h3 class="mume-header fontColor">1. 进程和线程标识符</h3> 837 838 <pre class="font-text light fontColor"><code class="fontColor"> 在通用操作系统中,进程号(pid/tgid)和线程号(tid)可能会被重复用于标识不同的进程或者线程。所以在trace数据源中,进程号(pid)和线程号(tid)也可能被重用。 839TraceStreamer在解析数据过程中,使用ipid(internal pid)唯一标识进程, itid(internal tid)唯一标识线程。 840</code></pre><h3 class="mume-header fontColor">2. 计量器</h3> 841 842 <p class="fontColor">用来记录系统中各种随时间连续变化的数值。例如: CPU的频率, 内存的使用量, 界面刷新频率。</p> 843 <h4 class="mume-header fontColor">举例</h4> 844 845 <p class="fontColor">CPU频率: <br> 846 <img src=".././figures/traceStreamer/cpu_frequency.png" alt="GitHub Logo"><br> 847 内存占用: <br> 848 <img src=".././figures/traceStreamer/mem_usage.png" alt="GitHub Logo"></p> 849 <h3 class="mume-header fontColor">3. 过滤器</h3> 850 851 <p class="fontColor">TraceStreamer设计过程中使用了流式处理的思想,数据从入口进入以后,就像进入一条河流,从上游流向下游,在河道中央有很多过滤器,每种过滤器会将流过的数据中自己关注的内容吸附捕捉到。最终,每个过滤器都拥有了大量同类型的数据,而且这些数据都是按时间序列排列的。TraceStreamer使用filterid来标识同一种用途的数据,可以方便在UI中绘制。 <br> 852 ![image][filterimageid]</p> 853 <h2 class="mume-header fontColor">Stat表设计</h2> 854 855 <p class="fontColor">具体内容参见 <a href="./des_stat.html">des_stat</a></p> 856 <h2 class="mume-header fontColor">trace_streamer开发环境搭建和编译运行指引</h2> 857 858 <p class="fontColor">本应用使用gn作为构建工具。</p> 859 <h3 class="mume-header fontColor">1、开发环境</h3> 860 861 <p class="fontColor">ubuntu和mac使用vscode</p> 862 <h1 class="mume-header fontColor">对外部的依赖</h1> 863 864 <p class="fontColor">本应用依赖与sqlite,protobuf(htrace解析部分依赖) </p> 865 <p class="fontColor">本应用同时依赖于src/protos目录下文件来生成相关pb.h,pb.cc文件 </p> 866 <h3 class="mume-header fontColor">2.1、 编译linux和Mac版应用</h3> 867 868 <p class="fontColor">在根目录下执行相关命令进行编译</p> 869 <h3 class="mume-header fontColor">2.2、 编译wasm</h3> 870 871 <p class="fontColor">在根目录下执行相关命令进行编译</p> 872 <h3 class="mume-header fontColor">2.3、开始编译</h3> 873 874 <p class="fontColor">具体方法可参考<a href="./compile_trace_streamer.html">compile_trace_streamer</a></p> 875 876 877</div> 878<script type="text/javascript"> 879 window.onload = (() => { 880 let isDark = window.location.search; 881 if (isDark.indexOf('?') !== -1) { 882 isDark = isDark.substr(1, isDark.length - 1); 883 } 884 if (isDark === 'true') { 885 document.getElementById('body').setAttribute('style', 'background-color:#272C34;'); 886 let header = document.getElementsByClassName('fontColor'); 887 for (let i = 0; i < header.length; i++) { 888 header[i].style.color = '#fff'; 889 } 890 let lightBackGround = document.getElementsByClassName('light'); 891 for (let i = 0; i < lightBackGround.length; i++) { 892 lightBackGround[i].style.backgroundColor = '#32373F'; 893 } 894 } 895 }); 896</script> 897</body> 898</html>