1<!DOCTYPE html> 2<html> 3<head> 4 <title>快速抓取trace说明</title> 5 <meta charset="utf-8"> 6 <meta content="width=device-width, initial-scale=1.0" name="viewport"> 7 <style> 8 code[class*="font-"], 9 pre[class*="font-"] { 10 text-align: left; 11 color: #333333; 12 background: none; 13 word-spacing: normal; 14 white-space: pre; 15 word-break: normal; 16 word-wrap: normal; 17 line-height: 1.5; 18 -moz-hyphens: none; 19 -ms-hyphens: none; 20 -o-tab-size: 8; 21 tab-size: 8; 22 -moz-tab-size: 8; 23 -webkit-hyphens: none; 24 hyphens: none; 25 font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 26 } 27 28 pre[class*="font-"] { 29 border-radius: 3px; 30 background: #F5F5F5; 31 padding: 0.8em; 32 overflow: auto; 33 } 34 35 :not(pre) > code[class*="font-"] { 36 white-space: normal; 37 background: #F5F5F5; 38 padding: 0.2em; 39 border-radius: 0.3em; 40 } 41 42 43 .temporary.cdata { 44 color: #183690; 45 } 46 47 .temporary.comment, 48 .temporary.blockquote { 49 color: #969897; 50 } 51 52 .temporary.doctype, 53 .temporary.punctuation, 54 .temporary.variable, 55 .temporary.macro.property { 56 color: #333333; 57 } 58 59 60 .temporary.string, 61 .temporary.url, 62 .temporary.regex, 63 .temporary.attr-value { 64 color: #183690; 65 } 66 67 .temporary.operator, 68 .temporary.important, 69 .temporary.keyword, 70 .temporary.rule, 71 .temporary.builtin { 72 color: #a71d5c; 73 } 74 75 .temporary.atrule, 76 .temporary.constant, 77 .temporary.symbol, 78 .temporary.command, 79 .temporary.property, 80 .temporary.number, 81 .temporary.boolean, 82 .temporary.entity, 83 .temporary.code { 84 color: #0086b2; 85 } 86 87 .temporary.tag, 88 .temporary.selector, 89 .temporary.prolog { 90 color: #63a35e; 91 } 92 93 .temporary.entity { 94 cursor: help; 95 } 96 97 .temporary.title, 98 .temporary.title .temporary.punctuation { 99 font-weight: bold; 100 color: #1d3e89; 101 } 102 103 .temporary.list { 104 color: #ed6a48; 105 } 106 107 .temporary.function, 108 .temporary.namespace, 109 .temporary.pseudo-element, 110 .temporary.class, 111 .temporary.class-name, 112 .temporary.pseudo-class, 113 .temporary.id, 114 .temporary.url-reference .temporary.variable, 115 .temporary.attr-name { 116 color: #795da2; 117 } 118 119 .temporary.inserted { 120 color: #55a535; 121 background-color: #eaffee; 122 } 123 124 .temporary.bold { 125 font-weight: bold; 126 } 127 128 .temporary.deleted { 129 color: #bd2c08; 130 background-color: #ffecea; 131 } 132 133 .font-json .temporary.property { 134 color: #183690; 135 } 136 137 .temporary.italic { 138 font-style: italic; 139 } 140 141 .font-markup .temporary.tag .temporary.punctuation { 142 color: #333333; 143 } 144 145 .font-yaml .temporary.atrule { 146 color: #63a35a; 147 } 148 149 code.font-css, 150 .font-css .temporary.function { 151 color: #0086b8; 152 } 153 154 code.font-yaml { 155 color: #183690; 156 } 157 158 .font-ruby .temporary.function { 159 color: #333333; 160 } 161 162 .font-markdown .temporary.url { 163 color: #795da2; 164 } 165 166 .font-makefile .temporary.variable { 167 color: #183690; 168 } 169 170 .font-makefile .temporary.builtin { 171 color: #0086b3; 172 } 173 174 .font-makefile .temporary.symbol { 175 color: #795da2; 176 } 177 178 .font-bash .temporary.keyword { 179 color: #0086b3; 180 } 181 182 pre[data-wire] { 183 padding: 1em 0 1em 2em; 184 position: relative; 185 } 186 187 pre[data-wire] .line-highlight-wrapper { 188 background-color: transparent; 189 top: 2px; 190 left: 2px; 191 display: block; 192 width: 100%; 193 position: absolute; 194 } 195 196 pre[data-wire] .line-highlight { 197 position: absolute; 198 left: 2px; 199 right: 2px; 200 pointer-events: none; 201 margin-top: 3em; 202 background: hsla(25, 10%, 55%, .06); 203 background: linear-gradient(to right, hsla(25, 10%, 40%, .2) 80%, hsla(23, 24%, 52%, 0)); 204 line-height: inherit; 205 white-space: pre; 206 } 207 208 pre[data-wire] .line-highlight:before, 209 pre[data-wire] .line-highlight[data-end]:after { 210 content: attr(data-start); 211 position: absolute; 212 background-color: hsla(22, 25%, 54%, .5); 213 min-width: 2em; 214 padding: 0 .6em 0 0; 215 top: 0.5em; 216 left: 0.4em; 217 color: hsl(22, 23%, 90%); 218 vertical-align: 0.3em; 219 border-radius: 10px; 220 text-shadow: none; 221 box-shadow: 0 2px white; 222 font: bold 60%/1.6 sans-serif; 223 text-align: center; 224 } 225 226 pre[data-wire] .line-highlight[data-end]:after { 227 bottom: 0.6em; 228 content: attr(data-end); 229 top: auto; 230 } 231 232 body > :first-child { 233 margin-top: 0; 234 } 235 236 body { 237 font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; 238 line-height: 1.6; 239 color: #333333; 240 background-color: #FFFFFF; 241 font-size: 16px; 242 overflow: initial; 243 word-wrap: break-word; 244 box-sizing: border-box; 245 } 246 247 body h1, body h2, body h3, body h4, body h5 { 248 line-height: 1.2; 249 margin-bottom: 16px; 250 margin-top: 1em; 251 color: #000000; 252 } 253 254 body h1 { 255 font-weight: 300; 256 font-size: 2.25em; 257 padding-bottom: 0.3em 258 } 259 260 body h2 { 261 font-weight: 400; 262 padding-bottom: 0.3em; 263 font-size: 1.75em; 264 } 265 266 body h3 { 267 font-weight: 500; 268 font-size: 1.5em; 269 } 270 271 body h4 { 272 font-weight: 600; 273 font-size: 1.25em; 274 } 275 276 body h5 { 277 font-weight: 600; 278 font-size: 1.1em; 279 } 280 281 body strong { 282 color: #000000; 283 } 284 285 body h1, body h2, body h3, body h4, body h5 { 286 font-weight: 600; 287 } 288 289 body del { 290 color: #5c5c5c; 291 } 292 293 body a:not([href]) { 294 text-decoration: none; 295 color: inherit; 296 } 297 298 body a { 299 text-decoration: none; 300 color: #08c; 301 } 302 303 body a:hover { 304 color: #00a3f5; 305 text-decoration: none; 306 } 307 308 body > p { 309 margin-bottom: 16px; 310 margin-top: 0; 311 word-wrap: break-word; 312 } 313 314 body img { 315 max-width: 100%; 316 } 317 318 body > ul, body > ol { 319 margin-bottom: 16px; 320 } 321 322 body ul, body ol { 323 padding-left: 2em; 324 } 325 326 body ul ul, body ul ol, body ol ol, body ol ul { 327 margin-top: 0; 328 margin-bottom: 0; 329 } 330 331 body ul.no-list, body ol.no-list { 332 padding: 0; 333 list-style-type: none; 334 } 335 336 body li.task-list-item { 337 list-style: none; 338 } 339 340 body li { 341 margin-bottom: 0; 342 } 343 344 body .task-list-item-checkbox { 345 vertical-align: middle; 346 margin: 0 .2em .25em -1.8em; 347 } 348 349 body li > p { 350 margin-bottom: 0; 351 margin-top: 0; 352 } 353 354 body .task-list-item-checkbox:hover { 355 cursor: pointer; 356 } 357 358 body blockquote { 359 color: #5c5c5c; 360 margin: 16px 0 0 0; 361 font-size: inherit; 362 padding: 0 15px; 363 background-color: #f0f0f0; 364 border-left: 4px solid #d6d6d6; 365 } 366 367 body blockquote > :first-child { 368 margin-top: 0; 369 } 370 371 body blockquote > :last-child { 372 margin-bottom: 0; 373 } 374 375 body hr { 376 margin: 32px 0 0 0; 377 height: 4px; 378 border: 0 none; 379 background-color: #d6d6d6; 380 } 381 382 body table { 383 display: block; 384 width: 100%; 385 margin: 10px 0 15px 0; 386 border-collapse: collapse; 387 border-spacing: 0; 388 word-break: normal; 389 overflow: auto; 390 word-break: keep-all; 391 } 392 393 body table th { 394 font-weight: bold; 395 color: #000000; 396 } 397 398 body table td, body table th { 399 padding: 6px 13px 0 0; 400 border: 1px solid #d6d6d6; 401 } 402 403 body dl { 404 padding: 0; 405 } 406 407 body dl dd { 408 padding: 0 16px 0 0; 409 margin-bottom: 16px; 410 } 411 412 body dl dt { 413 margin-top: 16px; 414 font-size: 1em; 415 padding: 0; 416 font-style: italic; 417 font-weight: bold; 418 } 419 420 body code { 421 color: #000000; 422 font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; 423 font-size: .85em !important; 424 background-color: #f0f0f0; 425 padding: 0.2em 0 0 0; 426 border-radius: 3px; 427 } 428 429 body code::before, body code::after { 430 content: "\00a0"; 431 letter-spacing: -0.2em; 432 } 433 434 body pre > code { 435 font-size: 0.85em !important; 436 padding: 0; 437 margin: 0; 438 background: transparent; 439 word-break: normal; 440 white-space: pre; 441 border: 0; 442 } 443 444 body .highlight { 445 margin-bottom: 16px; 446 } 447 448 body .highlight pre, body pre { 449 border: #d6d6d6; 450 font-size: 0.85em !important; 451 line-height: 1.45; 452 border-radius: 3px; 453 padding: 1em; 454 overflow: auto; 455 } 456 457 body .highlight pre { 458 word-break: normal; 459 margin-bottom: 0; 460 } 461 462 body pre code, body pre tt { 463 background-color: transparent; 464 padding: 0; 465 margin: 0; 466 display: inline; 467 max-width: initial; 468 overflow: initial; 469 line-height: inherit; 470 word-wrap: normal; 471 border: 0; 472 } 473 474 body pre code:before, body pre tt:before, body pre code:after, body pre tt:after { 475 content: normal; 476 } 477 478 body p, body blockquote, body ul, body ol, body dl, body pre { 479 margin-top: 0; 480 margin-bottom: 16px; 481 } 482 483 body kbd { 484 border: 1px solid #d6d6d6; 485 border-bottom: 2px solid #c7c7c7; 486 padding: 2px 4px; 487 background-color: #f0f0f0; 488 border-radius: 3px; 489 color: #000000; 490 } 491 492 @media print { 493 body { 494 background-color: #FFFFFF; 495 } 496 497 body h1, body h2, body h3, body h4, body h5 { 498 page-break-after: avoid; 499 color: #000000; 500 } 501 502 body blockquote { 503 color: #5c5c5c; 504 } 505 506 body pre { 507 page-break-inside: avoid; 508 } 509 510 body table { 511 display: table; 512 } 513 514 body img { 515 display: block; 516 max-width: 100%; 517 max-height: 100%; 518 } 519 520 body pre, body code { 521 white-space: pre; 522 word-wrap: break-word; 523 } 524 } 525 526 .md-preview { 527 width: 100%; 528 height: 100%; 529 box-sizing: border-box; 530 } 531 532 .md-preview, .md-preview { 533 page-break-before: always; 534 } 535 536 .md-preview pre.figure-numbers { 537 position: relative; 538 counter-reset: linenumber; 539 padding-left: 3.6em; 540 } 541 542 .md-preview pre.figure-numbers .figure-numbers-rows { 543 top: 1em; 544 font-size: 100%; 545 left: 0; 546 width: 3em; 547 position: absolute; 548 pointer-events: none; 549 letter-spacing: -1px; 550 border-right: 1px solid #999999; 551 -webkit-user-select: none; 552 user-select: none; 553 -moz-user-select: none; 554 -ms-user-select: none; 555 } 556 557 .md-preview pre.figure-numbers > code { 558 position: relative; 559 } 560 561 .md-preview pre.figure-numbers .figure-numbers-rows > span:before { 562 content: counter(linenumber); 563 color: #999999; 564 display: block; 565 text-align: right; 566 padding-right: 0.8em; 567 } 568 569 .md-preview pre.figure-numbers .figure-numbers-rows > span { 570 display: block; 571 pointer-events: none; 572 counter-increment: linenumber; 573 } 574 575 .md-preview:not([for="preview"]) .code-block .btn-group { 576 display: none; 577 } 578 579 .md-preview:not([for="preview"]) .code-block .status { 580 display: none; 581 } 582 583 .md-preview:not([for="preview"]) .code-block .output-div { 584 margin-bottom: 16px; 585 } 586 587 .scrollbar-type::-webkit-scrollbar { 588 width: 8px; 589 } 590 591 .scrollbar-type::-webkit-scrollbar-track { 592 background-color: transparent; 593 border-radius: 10px; 594 } 595 596 .scrollbar-type::-webkit-scrollbar-thumb { 597 border-radius: 5px; 598 border: 4px solid rgba(150, 150, 150, 0.65); 599 background-clip: content-box; 600 background-color: rgba(150, 150, 150, 0.65); 601 } 602 603 body[for="native-export"]:not([data-display-mode]) { 604 position: relative; 605 top: 0; 606 left: 0; 607 margin: 0; 608 padding: 0; 609 overflow: auto; 610 width: 100%; 611 height: 100%; 612 } 613 614 body[for="native-export"]:not([data-presentation-mode]) .md-preview { 615 position: relative; 616 top: 0; 617 } 618 619 @media screen and (min-width: 914px) { 620 body[for="native-export"]:not([data-presentation-mode]) .md-preview { 621 padding: 2em calc(50% - 457px + 2em); 622 } 623 } 624 625 @media screen and (max-width: 914px) { 626 body[for="native-export"]:not([data-presentation-mode]) .md-preview { 627 padding: 2em; 628 } 629 } 630 631 @media screen and (max-width: 450px) { 632 body[for="native-export"]:not([data-display-mode]) .md-preview { 633 font-size: 14px !important; 634 padding: 1em; 635 } 636 } 637 638 @media print { 639 body[for="native-export"]:not([data-presentation-mode]) #sidebarButton { 640 display: none; 641 } 642 } 643 644 body[for="native-export"]:not([data-presentation-mode]) #sidebarButton { 645 opacity: 0.5; 646 position: fixed; 647 bottom: 8px; 648 left: 8px; 649 z-index: 99; 650 width: 32px; 651 text-align: center; 652 font-size: 28px; 653 cursor: pointer; 654 color: inherit; 655 } 656 657 body[for="native-export"]:not([data-display-mode])[sidebarToc] #sidebarButton { 658 opacity: 1; 659 } 660 661 body[for="native-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc { 662 position: fixed; 663 top: 0; 664 left: 0; 665 padding: 32px 0 48px 0; 666 width: 300px; 667 height: 100%; 668 font-size: 14px; 669 box-shadow: 0 0 4px rgba(150, 150, 150, 0.33); 670 box-sizing: border-box; 671 overflow: auto; 672 background-color: inherit; 673 } 674 675 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc::-webkit-scrollbar { 676 width: 8px; 677 } 678 679 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc::-webkit-scrollbar-track { 680 background-color: transparent; 681 border-radius: 10px; 682 } 683 684 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc::-webkit-scrollbar-thumb { 685 background-color: rgba(150, 150, 150, 0.65); 686 border-radius: 5px; 687 border: 4px solid rgba(150, 150, 150, 0.65); 688 background-clip: content-box; 689 } 690 691 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc li { 692 margin-bottom: 0.8em; 693 } 694 695 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc ul { 696 list-style-type: none; 697 } 698 699 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc ul { 700 margin-top: 0.8em; 701 padding: 0 1.4em 0 0; 702 } 703 704 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-sidebar-toc a { 705 text-decoration: none; 706 } 707 708 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-preview { 709 padding: 2em calc(50% - 457px - 150px); 710 margin: 0; 711 box-sizing: border-box; 712 left: 300px; 713 width: calc(100% - 300px); 714 } 715 716 @media screen and (max-width: 450px) { 717 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-preview { 718 width: 100%; 719 } 720 } 721 722 @media screen and (max-width: 1274px) { 723 body[for="native-export"]:not([data-display-mode])[sidebarToc] .md-preview { 724 padding: 2em; 725 } 726 } 727 728 body[for="native-export"]:not([data-display-mode]):not([sidebarToc]) .md-preview { 729 transform: translateX(-50%); 730 left: 50%; 731 } 732 733 body[for="native-export"]:not([data-display-mode]):not([sidebarToc]) .md-sidebar-toc { 734 display: none; 735 } 736 </style> 737</head> 738<body for="native-export" id="body"> 739<div class="mume md-preview "> 740 <h1 class="mume-header fontColor">快速抓取trace说明</h1> 741 742 743 <h2 class="mume-header fontColor">1.界面配置说明</h2> 744 745 <p class="fontColor"><img alt="GitHub Logo" src="../figures/systraceconfig.jpg"><br> 746 说明:</p> 747 <ul class="fontColor"> 748 <li>Record setting:设置trace的抓取模式,buffer size大小,抓取时长</li> 749 <li>Trace command:生成的抓取命令行</li> 750 <li>Probes config:trace的抓取参数配置</li> 751 <li>Native Memory:NativeMemory数据的抓取参数配置</li> 752 <li>Hiperf:Hiperf数据的抓取参数配置</li> 753 </ul> 754 <h2 class="mume-header fontColor">2.命令行的生成和trace文件的抓取</h2> 755 <p class="fontColor">点击Probes config,如选择抓取Scheduling details<br> 756 <img alt="GitHub Logo" src="../figures/Scheduling.jpg"><br> 757 再点击Record setting,在output file path输入文件名hiprofiler_data_example.htrace,拖动滚动条设置buffer size大小是64M,抓取时长是50s<br> 758 <img alt="GitHub Logo" src="../figures/tracesetting.jpg"><br> 759 点击Trace command,就会根据上面的配置生成抓取命令,点击复制按钮,会将命令行复制 760 <br> 761 <img alt="GitHub Logo" src="../figures/command.jpg"><br> 762 <p class="fontColor"> 763 命令参数说明:</p> 764 <ul class="fontColor"> 765 <li>-o:文件的输入路径和名称</li> 766 <li>-t:抓取的时长</li> 767 <li>buffer pages:buffer size大小</li> 768 <li>sample_interval:轮循模式下,插件上报数据的间隔时间(ms)</li> 769 <li>trace_period_ms:ftrace插件读取内核缓冲区数据的间隔时间(ms)</li> 770 <li>hitrace_time:hitrace命令行抓取时间,与hiprofiler_cmd下发的-t配置联动</li> 771 </ul> 772 <p class="fontColor">输入hdc_shell,进入设备,执行命令<br> 773 <img alt="GitHub Logo" src="../figures/excutecommand.jpg"><br> 774 <p class="fontColor">执行完成后,命令行会给出提示<br> 775 <img alt="GitHub Logo" src="../figures/commandend.jpg"><br> 776 <p class="fontColor">进入指定目录,cd /data/local/tmp 进入到目录,会看到生成的trace文件<br> 777 <img alt="GitHub Logo" src="../figures/htrace.jpg"><br> 778</div> 779 780<script type="text/javascript"> 781 window.onload = (() => { 782 let isDark = window.location.search; 783 if (isDark.indexOf("?") != -1) { 784 isDark = isDark.substr(1, isDark.length - 1); 785 } 786 if (isDark == 'true') { 787 document.getElementById("body").setAttribute('style', 'background-color:#272C34;') 788 let header = document.getElementsByClassName('fontColor') 789 for (let i = 0; i < header.length; i++) { 790 header[i].style.color = '#fff'; 791 } 792 let lightBackGround = document.getElementsByClassName('light') 793 for (let i = 0; i < lightBackGround.length; i++) { 794 lightBackGround[i].style.backgroundColor = '#32373F' 795 } 796 } 797 }) 798</script> 799</body> 800</html>