brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.7 KiB · 6fbfbdb Raw
252 lines · plain
1; RUN: split-file %s %t2; COM: The text format only supports the latest version.3 4; Verify that the YAML output is identical to the YAML input.5; memprof-in.yaml has both heap profile records and data access profiles.6; RUN: llvm-profdata merge --memprof-version=4 %t/memprof-in.yaml -o %t/memprof-out.indexed7; RUN: llvm-profdata show --memory %t/memprof-out.indexed > %t/memprof-out.yaml8; RUN: diff -b %t/memprof-in.yaml %t/memprof-out.yaml9 10; Merge text profile as v3 binary profile. Test that the merged v3 profile11; are identical to memprof-in-v3.yaml, and doesn't have callee guids or dap.12; RUN: llvm-profdata merge --memprof-version=3 %t/memprof-in.yaml -o %t/memprof-out-v3.indexed13; RUN: llvm-profdata show --memory %t/memprof-out-v3.indexed > %t/memprof-out-v3.yaml14; RUN: diff -b %t/memprof-out-v3.yaml %t/memprof-in-v3.yaml15 16; Make sure we can ingest a YAML profile containing AllocSites only.17; That is, CallSites are missing.18; RUN: llvm-profdata merge --memprof-version=4 %t/memprof-in-alloc-sites-only.yaml -o %t/memprof-out-alloc-sites-only.indexed19; RUN: llvm-profdata show --memory %t/memprof-out-alloc-sites-only.indexed > %t/memprof-out-alloc-sites-only.yaml20; RUN: diff -b %t/memprof-out-alloc-sites-only.yaml %t/memprof-in-alloc-sites-only.yaml21 22; Make sure we can ingest a YAML profile containing CallSites only.23; That is, AllocSites are missing.24; RUN: llvm-profdata merge --memprof-version=4 %t/memprof-in-call-sites-only.yaml -o %t/memprof-out-call-sites-only.indexed25; RUN: llvm-profdata show --memory %t/memprof-out-call-sites-only.indexed > %t/memprof-out-call-sites-only.yaml26; RUN: diff -b %t/memprof-out-call-sites-only.yaml %t/memprof-in-call-sites-only.yaml27 28; memprof-in-no-dap.yaml has empty data access profiles.29; RUN: llvm-profdata merge --memprof-version=4 %t/memprof-in-no-dap.yaml -o %t/memprof-out.indexed30; RUN: llvm-profdata show --memory %t/memprof-out.indexed > %t/memprof-out-no-dap.yaml31; RUN: diff -b %t/memprof-in-no-dap.yaml %t/memprof-out-no-dap.yaml32 33; memprof-in-no-heap.yaml has empty heap access profiles.34; RUN: llvm-profdata merge --memprof-version=4 %t/memprof-in-no-heap.yaml -o %t/memprof-out-no-heap.indexed35; RUN: llvm-profdata show --memory %t/memprof-out-no-heap.indexed > %t/memprof-out-no-heap.yaml36; RUN: diff -b %t/memprof-in-no-heap.yaml %t/memprof-out-no-heap.yaml37 38;--- memprof-in.yaml39---40# MemProfSummary:41#   Total contexts: 242#   Total cold contexts: 043#   Total hot contexts: 044#   Maximum cold context total size: 045#   Maximum warm context total size: 66646#   Maximum hot context total size: 047---48HeapProfileRecords:49  - GUID:            0xdeadbeef1234567850    AllocSites:51      - Callstack:52          - { Function: 0x1111111111111111, LineOffset: 11, Column: 10, IsInlineFrame: true }53          - { Function: 0x2222222222222222, LineOffset: 22, Column: 20, IsInlineFrame: false }54        MemInfoBlock:55          AllocCount:      11156          TotalSize:       22257          TotalLifetime:   33358          TotalLifetimeAccessDensity: 44459      - Callstack:60          - { Function: 0x3333333333333333, LineOffset: 33, Column: 30, IsInlineFrame: false }61          - { Function: 0x4444444444444444, LineOffset: 44, Column: 40, IsInlineFrame: true }62        MemInfoBlock:63          AllocCount:      55564          TotalSize:       66665          TotalLifetime:   77766          TotalLifetimeAccessDensity: 88867    CallSites:68      - Frames:69        - { Function: 0x5555555555555555, LineOffset: 55, Column: 50, IsInlineFrame: true }70        - { Function: 0x6666666666666666, LineOffset: 66, Column: 60, IsInlineFrame: false }71        CalleeGuids: [ 0x100, 0x200 ]72      - Frames:73        - { Function: 0x7777777777777777, LineOffset: 77, Column: 70, IsInlineFrame: true }74        - { Function: 0x8888888888888888, LineOffset: 88, Column: 80, IsInlineFrame: false }75        CalleeGuids: [ 0x300 ]76DataAccessProfiles:77  SampledRecords:78    - Symbol:          abcde79      AccessCount:     10080      Locations:81      - FileName:      file2.h82        Line:          12383      - FileName:      file3.cpp84        Line:          45685    - Hash:            10101086      AccessCount:     20087      Locations:88        - FileName:        file.cpp89          Line:            23390  KnownColdSymbols:91    - foo92    - bar93  KnownColdStrHashes: [ 999, 1001 ]94...95;--- memprof-in-v3.yaml96---97# MemProfSummary:98#   Total contexts: 299#   Total cold contexts: 0100#   Total hot contexts: 0101#   Maximum cold context total size: 0102#   Maximum warm context total size: 666103#   Maximum hot context total size: 0104---105HeapProfileRecords:106  - GUID:            0xdeadbeef12345678107    AllocSites:108      - Callstack:109          - { Function: 0x1111111111111111, LineOffset: 11, Column: 10, IsInlineFrame: true }110          - { Function: 0x2222222222222222, LineOffset: 22, Column: 20, IsInlineFrame: false }111        MemInfoBlock:112          AllocCount:      111113          TotalSize:       222114          TotalLifetime:   333115          TotalLifetimeAccessDensity: 444116      - Callstack:117          - { Function: 0x3333333333333333, LineOffset: 33, Column: 30, IsInlineFrame: false }118          - { Function: 0x4444444444444444, LineOffset: 44, Column: 40, IsInlineFrame: true }119        MemInfoBlock:120          AllocCount:      555121          TotalSize:       666122          TotalLifetime:   777123          TotalLifetimeAccessDensity: 888124    CallSites:125      - Frames:126        - { Function: 0x5555555555555555, LineOffset: 55, Column: 50, IsInlineFrame: true }127        - { Function: 0x6666666666666666, LineOffset: 66, Column: 60, IsInlineFrame: false }128      - Frames:129        - { Function: 0x7777777777777777, LineOffset: 77, Column: 70, IsInlineFrame: true }130        - { Function: 0x8888888888888888, LineOffset: 88, Column: 80, IsInlineFrame: false }131...132;--- memprof-in-alloc-sites-only.yaml133---134# MemProfSummary:135#   Total contexts: 2136#   Total cold contexts: 0137#   Total hot contexts: 0138#   Maximum cold context total size: 0139#   Maximum warm context total size: 666140#   Maximum hot context total size: 0141---142HeapProfileRecords:143  - GUID:            0xdeadbeef12345678144    AllocSites:145      - Callstack:146          - { Function: 0x1111111111111111, LineOffset: 11, Column: 10, IsInlineFrame: true }147          - { Function: 0x2222222222222222, LineOffset: 22, Column: 20, IsInlineFrame: false }148        MemInfoBlock:149          AllocCount:      111150          TotalSize:       222151          TotalLifetime:   333152          TotalLifetimeAccessDensity: 444153      - Callstack:154          - { Function: 0x3333333333333333, LineOffset: 33, Column: 30, IsInlineFrame: false }155          - { Function: 0x4444444444444444, LineOffset: 44, Column: 40, IsInlineFrame: true }156        MemInfoBlock:157          AllocCount:      555158          TotalSize:       666159          TotalLifetime:   777160          TotalLifetimeAccessDensity: 888161...162;--- memprof-in-call-sites-only.yaml163---164# MemProfSummary:165#   Total contexts: 0166#   Total cold contexts: 0167#   Total hot contexts: 0168#   Maximum cold context total size: 0169#   Maximum warm context total size: 0170#   Maximum hot context total size: 0171---172HeapProfileRecords:173  - GUID:            0xdeadbeef12345678174    CallSites:175      - Frames:176        - { Function: 0x5555555555555555, LineOffset: 55, Column: 50, IsInlineFrame: true }177        - { Function: 0x6666666666666666, LineOffset: 66, Column: 60, IsInlineFrame: false }178        CalleeGuids: [ 0x100, 0x200 ]179      - Frames:180        - { Function: 0x7777777777777777, LineOffset: 77, Column: 70, IsInlineFrame: true }181        - { Function: 0x8888888888888888, LineOffset: 88, Column: 80, IsInlineFrame: false }182        CalleeGuids: [ 0x300 ]183...184;--- memprof-in-no-dap.yaml185---186# MemProfSummary:187#   Total contexts: 2188#   Total cold contexts: 0189#   Total hot contexts: 0190#   Maximum cold context total size: 0191#   Maximum warm context total size: 666192#   Maximum hot context total size: 0193---194HeapProfileRecords:195  - GUID:            0xdeadbeef12345678196    AllocSites:197      - Callstack:198          - { Function: 0x1111111111111111, LineOffset: 11, Column: 10, IsInlineFrame: true }199          - { Function: 0x2222222222222222, LineOffset: 22, Column: 20, IsInlineFrame: false }200        MemInfoBlock:201          AllocCount:      111202          TotalSize:       222203          TotalLifetime:   333204          TotalLifetimeAccessDensity: 444205      - Callstack:206          - { Function: 0x3333333333333333, LineOffset: 33, Column: 30, IsInlineFrame: false }207          - { Function: 0x4444444444444444, LineOffset: 44, Column: 40, IsInlineFrame: true }208        MemInfoBlock:209          AllocCount:      555210          TotalSize:       666211          TotalLifetime:   777212          TotalLifetimeAccessDensity: 888213    CallSites:214      - Frames:215        - { Function: 0x5555555555555555, LineOffset: 55, Column: 50, IsInlineFrame: true }216        - { Function: 0x6666666666666666, LineOffset: 66, Column: 60, IsInlineFrame: false }217        CalleeGuids: [ 0x100, 0x200 ]218      - Frames:219        - { Function: 0x7777777777777777, LineOffset: 77, Column: 70, IsInlineFrame: true }220        - { Function: 0x8888888888888888, LineOffset: 88, Column: 80, IsInlineFrame: false }221        CalleeGuids: [ 0x300 ]222...223;--- memprof-in-no-heap.yaml224---225# MemProfSummary:226#   Total contexts: 0227#   Total cold contexts: 0228#   Total hot contexts: 0229#   Maximum cold context total size: 0230#   Maximum warm context total size: 0231#   Maximum hot context total size: 0232---233DataAccessProfiles:234  SampledRecords:235    - Symbol:          abcde236      AccessCount:     100237      Locations:238      - FileName:      file2.h239        Line:          123240      - FileName:      file3.cpp241        Line:          456242    - Hash:            101010243      AccessCount:     200244      Locations:245        - FileName:        file.cpp246          Line:            233247  KnownColdSymbols:248    - foo249    - bar250  KnownColdStrHashes: [ 999, 1001 ]251...252