build: SystemTap 4.7 (RISC-V support) #25360

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:systemtap_4_7 changing 2 files +11 −15
  1. fanquake commented at 2:37 pm on June 13, 2022: member

    As of version 4.6, SystemTap now fully supports 64-bit RISC-V.

    Full SystemTap NEWS is here: https://sourceware.org/git/?p=systemtap.git;a=blob;f=NEWS;

    Guix Build (x86_64):

     02c4cf36ea601de27ce1b56b923d41aee30d9d64295a700dcc705bd518865c81c  guix-build-b8c146b87720/output/aarch64-linux-gnu/SHA256SUMS.part
     110dbe855ab64e0e76398fc27e9471071820b9cd5289773c8d9d272f9bb51b7ba  guix-build-b8c146b87720/output/aarch64-linux-gnu/bitcoin-b8c146b87720-aarch64-linux-gnu-debug.tar.gz
     2530808f3803a31c4fe84ec85e7b6c284e52850ba32df12dd1e273e9896bad7ff  guix-build-b8c146b87720/output/aarch64-linux-gnu/bitcoin-b8c146b87720-aarch64-linux-gnu.tar.gz
     39fa9e1f2412854f87d980e97cb7b4df37a1a13d48a633b9df5b0006d60c10ede  guix-build-b8c146b87720/output/arm-linux-gnueabihf/SHA256SUMS.part
     4dcf44666f80b71637403d5f6fb4eb8159ef61815b3feedc84e3a26c99bd18152  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf-debug.tar.gz
     58623a1e969a8f40286060ebbd9085f3d4f621c507fd5448b38ba36129ba0950a  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf.tar.gz
     659a71bdc8403f4fff4370922a297a7a2200b0a206d68ac71960f09e728bf0781  guix-build-b8c146b87720/output/arm64-apple-darwin/SHA256SUMS.part
     75e17c76526da9f4630ffed2cc2870aa058139fa439d4c756055d8b9f53fc05dc  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.dmg
     872ebdf006dd279128b33e3b0902f8d3d1291d90fd2d67be60bbbd0f0d5e5b336  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.tar.gz
     9d3a1bafba070e8197d2d3f790053b6204e6779b8352c41118c82e16f2e500620  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin.tar.gz
    1076510b7e6aaccfa8c0f370e1a6d4b6f79e21572ebc0a369d2195557cfc9f6966  guix-build-b8c146b87720/output/dist-archive/bitcoin-b8c146b87720.tar.gz
    11cb18e130efa70ca58df2b89d7cc368f0374ad3cf6c59f97cee4c12cfbec6982c  guix-build-b8c146b87720/output/powerpc64-linux-gnu/SHA256SUMS.part
    121028f9deaa1bd140ead816e0278ea5f3eb27e0d70e3e3b11d1f6098da46a0538  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu-debug.tar.gz
    13013d97e33f51b985b2b514dbdae093806c890d9f6ca58aec1d62814a874efb8a  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu.tar.gz
    143b2cfa1d9418682eeed02718de36137e330573df24b28b5681301a5cb5320e6b  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/SHA256SUMS.part
    15480fd977d8eda3bb9440bfa3e37452ecbeb0f1f4e36a35f6bfa820e7666d2a71  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu-debug.tar.gz
    16eabab79ff95df3f326dc1e40dba4925b9a6de374763180c4170a30cdfe26136a  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu.tar.gz
    177f5b6d482bee0c73cf0727395d78591559ab974a2b9bff9689ca2262d0612f39  guix-build-b8c146b87720/output/riscv64-linux-gnu/SHA256SUMS.part
    18228cc22329e50d99edc33465f10e136742833ebc675920bdbde07ca3388523d7  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu-debug.tar.gz
    19b5d2565a0b05d51e9834c0212b34903c362061c2489878c82dfbe04729cefa2c  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu.tar.gz
    20dde6dcf82d7b2f3279150564302a5008d69a3a0fcdedc717c124d460d73ff71d  guix-build-b8c146b87720/output/x86_64-apple-darwin/SHA256SUMS.part
    21a5c2e69aba46a164425013b0360674d77687dfe8accc8e8cb97dc630542dc1d3  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.dmg
    22cea73001db5a31880ec119f959bb0db21b3f7a12ac21a630b2f12247c4c0b578  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.tar.gz
    238cf6ba1de32f68c70ee23a19fbbeadb59df4c008792c717ac22d476ebe9aa921  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin.tar.gz
    24061247b31ba1012689817e304357fca0b7262106223d6eaf8d0b31148bd764d1  guix-build-b8c146b87720/output/x86_64-linux-gnu/SHA256SUMS.part
    2520caf9d234a88333b696e0261284c29ea4f83c3b9e590696230614220b2c7e2e  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu-debug.tar.gz
    2654c3e57cc4cc6173aa2bb4e17f47e85a346ef752973d6b97f7a3ff015d4f5068  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu.tar.gz
    2747f4104cbd46c96bf9c3cb4fcf9e813ee73566781a599e850bf8c5c8d6e7970a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/SHA256SUMS.part
    28b337b2841988f0cdcd8aebec669467f38354b626a7d331e84a5a7b7fc47f6a47  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-debug.zip
    2925e97d46edb35dd87a55b285dad03a6c571336ab93f8c7457571498e3057118a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-setup-unsigned.exe
    30bc9870404d52a5423ce8fee37cae3ebda00d9958b1469d2930aa8f0d61ab55ef  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-unsigned.tar.gz
    31194615a1645bed622d91e8760cd3ec33fd0ef684dd6a7a04d1731272f7fd1557  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64.zip
    

    Guix Build (arm64):

     0442bf81809c481be38317703bdf6ae45d9dd6f1b044515dfe36be514eae8b66a  guix-build-b8c146b87720/output/arm-linux-gnueabihf/SHA256SUMS.part
     1a104a61a1dd4f663e809344cc86d500254d4d451f23c062f48e50c6418fcd135  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf-debug.tar.gz
     212f84be1ad44d28595144bbb6319cb2f6fb95b27c633f54771815ccff4fb40aa  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf.tar.gz
     3e6b42524123488ef3342d0806ac562985a1fff214c1bfcd1a26ab8e288caf24a  guix-build-b8c146b87720/output/arm64-apple-darwin/SHA256SUMS.part
     4bb01d384bff21c5280d4a193bd4fb158ecaa41d0746db30a52c135e5a6e76750  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.dmg
     52ebeca13939e408aae304f77eb32c683ce703262475d70f9c0a9a51533cabdb4  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.tar.gz
     6b5df98dc9b66eb1ae725c050f9e1d94a551ce9637cef29f82cb38ef784996c1c  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin.tar.gz
     776510b7e6aaccfa8c0f370e1a6d4b6f79e21572ebc0a369d2195557cfc9f6966  guix-build-b8c146b87720/output/dist-archive/bitcoin-b8c146b87720.tar.gz
     8d38cc0e933f37108f71d826e20d6cc1510fe98d830484977d032fbb66d94ab02  guix-build-b8c146b87720/output/powerpc64-linux-gnu/SHA256SUMS.part
     98dc33ebac8ec67cefe842419015ab42f344971a9fe071bda2b09f6b1696fea68  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu-debug.tar.gz
    1057b01141e859246a70c9110c5daa2b388dfc5bab442a873f6b715981bd3dfca1  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu.tar.gz
    11282befd619cfb541c31d1a81495e08c409f2d9174e876f05dc7bd361a3a1821e  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/SHA256SUMS.part
    128ef3a9e19393ef36c8a001477e9ee08dba705978775fcebb5c2349612ce22808  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu-debug.tar.gz
    13bbfde476e8f630783a12e9d900d91ab2ab24ee2c7e607699e37fd2d273627a0e  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu.tar.gz
    14b0f8f33becc355ab70f549ed4d33b49f73aa5b4adb793b0e661ff1180861cdba  guix-build-b8c146b87720/output/riscv64-linux-gnu/SHA256SUMS.part
    157ee185e1aa6a7b4c536f375d165dd0232a310892a2e9446de713081b471d5d9e  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu-debug.tar.gz
    168d15acb1da57c753131e887453d95c0539f2d4bbb4e3a6deb976e17dee306946  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu.tar.gz
    17dde6dcf82d7b2f3279150564302a5008d69a3a0fcdedc717c124d460d73ff71d  guix-build-b8c146b87720/output/x86_64-apple-darwin/SHA256SUMS.part
    18a5c2e69aba46a164425013b0360674d77687dfe8accc8e8cb97dc630542dc1d3  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.dmg
    19cea73001db5a31880ec119f959bb0db21b3f7a12ac21a630b2f12247c4c0b578  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.tar.gz
    208cf6ba1de32f68c70ee23a19fbbeadb59df4c008792c717ac22d476ebe9aa921  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin.tar.gz
    21a05b02f8270bc1928e89ac03d2ab40da9e1fc35cf5416c511fe67a197c64b241  guix-build-b8c146b87720/output/x86_64-linux-gnu/SHA256SUMS.part
    229f213cfc3afb899cf1e06b796f0ab7e4414f60e267f286837d10944c592d0cad  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu-debug.tar.gz
    237f8100bbf4415f4cf531e0b652026e1429877df873bce6b45433e7e1b638efe4  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu.tar.gz
    248d5ad864562ca22a37380a89db7a78574462b78bd74fcf8b663b8164043e800f  guix-build-b8c146b87720/output/x86_64-w64-mingw32/SHA256SUMS.part
    253713b4d70e4eb56b0875d07c698eab270c680da0f81be5394ea16750c5b56490  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-debug.zip
    2625e97d46edb35dd87a55b285dad03a6c571336ab93f8c7457571498e3057118a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-setup-unsigned.exe
    27bc9870404d52a5423ce8fee37cae3ebda00d9958b1469d2930aa8f0d61ab55ef  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-unsigned.tar.gz
    281d78eb522fdebb8e494c63656212972657f323406b43a5f6af835f272529915f  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64.zip
    
  2. build: systemtap 4.7
    From 4.6, SystemTap now supports 64-bit RISC-V.
    
    * What's new in version 4.6, 2021-11-15
    - SystemTap has added support for the 64-bit RISC-V architecture.
    b8c146b877
  3. fanquake added the label Build system on Jun 13, 2022
  4. fanquake requested review from laanwj on Jun 13, 2022
  5. fanquake requested review from 0xB10C on Jun 13, 2022
  6. laanwj commented at 2:45 pm on June 13, 2022: member
    Concept ACK, going to test.
  7. laanwj commented at 5:03 pm on June 13, 2022: member

    I haven’t verified whether they work, but readelf -n bitcoind on the GUIX-built RISC-V binary correctly shows the available probles:

     0Displaying notes found in: .note.stapsdt
     1  Owner                Data size        Description
     2  stapsdt              0x00000050       NT_STAPSDT (SystemTap probe descriptors)
     3    Provider: net
     4    Name: outbound_message
     5    Location: 0x00000000000b1dd4, Base: 0x0000000000986690, Semaphore: 0x0000000000000000
     6    Arguments: -8@s0 8@s3 8@a0 8@24(s2) 8@a5 8@a4
     7  stapsdt              0x00000055       NT_STAPSDT (SystemTap probe descriptors)
     8    Provider: net
     9    Name: inbound_message
    10    Location: 0x00000000000ec18c, Base: 0x0000000000986690, Semaphore: 0x0000000000000000
    11    Arguments: -8@s9 8@s10 8@232(sp) 8@72(s5) 8@a5 8@a4
    12  stapsdt              0x00000046       NT_STAPSDT (SystemTap probe descriptors)
    13    Provider: utxocache
    14    Name: flush
    15    Location: 0x0000000000253db4, Base: 0x0000000000986690, Semaphore: 0x0000000000000000
    16    Arguments: -8@s3 4@s2 8@8(sp) 8@s7 1@s10
    17

    gdb output:

     0(gdb) info probes
     1Type Provider       Name                      Where              Semaphore Object
     2stap coin_selection aps_create_tx_internal    0x000000000033194a           …/bitcoin-b8c146b87720/bin/bitcoind
     3stap coin_selection attempting_aps_create_tx  0x0000000000331794           …/bitcoin-b8c146b87720/bin/bitcoind
     4stap coin_selection normal_create_tx_internal 0x00000000003316ee           …/bitcoin-b8c146b87720/bin/bitcoind
     5stap coin_selection selected_coins            0x000000000032fe42           …/bitcoin-b8c146b87720/bin/bitcoind
     6stap net            inbound_message           0x00000000000ec18c           …/bitcoin-b8c146b87720/bin/bitcoind
     7stap net            outbound_message          0x00000000000b1dd4           …/bitcoin-b8c146b87720/bin/bitcoind
     8stap utxocache      add                       0x000000000043dda4           …/bitcoin-b8c146b87720/bin/bitcoind
     9stap utxocache      flush                     0x0000000000253db4           …/bitcoin-b8c146b87720/bin/bitcoind
    10stap utxocache      spent                     0x000000000043e328           …/bitcoin-b8c146b87720/bin/bitcoind
    11stap utxocache      uncache                   0x000000000043d6da           …/bitcoin-b8c146b87720/bin/bitcoind
    12stap validation     block_connected           0x000000000025a09a           …/bitcoin-b8c146b87720/bin/bitcoind
    
  8. laanwj commented at 7:45 pm on June 13, 2022: member

    I have tried to run the tracepoint tests in RISC-V, however, the necessary bcc python binding is not installable on this platform yet:

     0root@loreley# apt install python3-bpfcc
     1Reading package lists... Done
     2Building dependency tree... Done
     3Reading state information... Done
     4Some packages could not be installed. This may mean that you have
     5requested an impossible situation or if you are using the unstable
     6distribution that some required packages have not yet been created
     7or been moved out of Incoming.
     8The following information may help to resolve the situation:
     9
    10The following packages have unmet dependencies:
    11 python3-bpfcc : Depends: libbpfcc (>= 0.24.0+ds-1) but it is not installable
    12E: Unable to correct problems, you have held broken packages.
    13root@loreley# apt install libbpfcc
    14Reading package lists... Done
    15Building dependency tree... Done
    16Reading state information... Done
    17Package libbpfcc is not available, but is referred to by another package.
    18This may mean that the package is missing, has been obsoleted, or
    19is only available from another source
    20
    21E: Package 'libbpfcc' has no installation candidate
    

    It might be possible to build it from source, I’m not sure, I think there’s some problems around LLVM.

    So, I’ve tried to test in a different way, by breaking on the tracepoint using gdb. This seems to work, at first:

     0(gdb) break -probe-stap net:inbound_message
     1Breakpoint 1 at 0xec18c
     2(gdb) run
     3Starting program: …/bitcoin-b8c146b87720/bin/bitcoind
     4[Thread debugging using libthread_db enabled]
     5Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
     62022-06-13T19:41:52Z Bitcoin Core version v23.99.0-gb8c146b8772030c6efaac43198c4de0d76fd25af (release build)
     7 8[Thread 0x3fcaffd110 (LWP 19993) exited]
     9[Switching to Thread 0x3fc97fa110 (LWP 19996)]
    10
    11Thread 17 "b-msghand" hit Breakpoint 1, 0x0000002aaab9618c in ?? ()
    

    Printing the arguments apparently doesn’t work on this platform yet!

    0(gdb) print $_probe_arg0
    1warning: The SystemTap SDT probe support is not fully implemented on this target;
    2you will not be able to inspect the arguments of the probes.
    3Please report a bug against GDB requesting a port to this target.
    4Invalid probe argument 0 -- probe has 0 arguments available
    
  9. laanwj added this to the milestone 24.0 on Jun 14, 2022
  10. DrahtBot commented at 8:35 am on June 15, 2022: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    No conflicts as of last run.

  11. jarolrod commented at 2:51 pm on June 15, 2022: member

    GUIX hashes on arm64, mine match @fanquake:

     0$ env HOSTS='arm-linux-gnueabihf arm64-apple-darwin powerpc64-linux-gnu powerpc64le-linux-gnu riscv64-linux-gnu x86_64-apple-darwin x86_64-linux-gnu x86_64-w64-mingw32' ./contrib/guix/guix-build 
     1$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
     2
     3442bf81809c481be38317703bdf6ae45d9dd6f1b044515dfe36be514eae8b66a  guix-build-b8c146b87720/output/arm-linux-gnueabihf/SHA256SUMS.part
     4a104a61a1dd4f663e809344cc86d500254d4d451f23c062f48e50c6418fcd135  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf-debug.tar.gz
     512f84be1ad44d28595144bbb6319cb2f6fb95b27c633f54771815ccff4fb40aa  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf.tar.gz
     6e6b42524123488ef3342d0806ac562985a1fff214c1bfcd1a26ab8e288caf24a  guix-build-b8c146b87720/output/arm64-apple-darwin/SHA256SUMS.part
     7bb01d384bff21c5280d4a193bd4fb158ecaa41d0746db30a52c135e5a6e76750  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.dmg
     82ebeca13939e408aae304f77eb32c683ce703262475d70f9c0a9a51533cabdb4  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.tar.gz
     9b5df98dc9b66eb1ae725c050f9e1d94a551ce9637cef29f82cb38ef784996c1c  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin.tar.gz
    1076510b7e6aaccfa8c0f370e1a6d4b6f79e21572ebc0a369d2195557cfc9f6966  guix-build-b8c146b87720/output/dist-archive/bitcoin-b8c146b87720.tar.gz
    11d38cc0e933f37108f71d826e20d6cc1510fe98d830484977d032fbb66d94ab02  guix-build-b8c146b87720/output/powerpc64-linux-gnu/SHA256SUMS.part
    128dc33ebac8ec67cefe842419015ab42f344971a9fe071bda2b09f6b1696fea68  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu-debug.tar.gz
    1357b01141e859246a70c9110c5daa2b388dfc5bab442a873f6b715981bd3dfca1  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu.tar.gz
    14282befd619cfb541c31d1a81495e08c409f2d9174e876f05dc7bd361a3a1821e  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/SHA256SUMS.part
    158ef3a9e19393ef36c8a001477e9ee08dba705978775fcebb5c2349612ce22808  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu-debug.tar.gz
    16bbfde476e8f630783a12e9d900d91ab2ab24ee2c7e607699e37fd2d273627a0e  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu.tar.gz
    17b0f8f33becc355ab70f549ed4d33b49f73aa5b4adb793b0e661ff1180861cdba  guix-build-b8c146b87720/output/riscv64-linux-gnu/SHA256SUMS.part
    187ee185e1aa6a7b4c536f375d165dd0232a310892a2e9446de713081b471d5d9e  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu-debug.tar.gz
    198d15acb1da57c753131e887453d95c0539f2d4bbb4e3a6deb976e17dee306946  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu.tar.gz
    20dde6dcf82d7b2f3279150564302a5008d69a3a0fcdedc717c124d460d73ff71d  guix-build-b8c146b87720/output/x86_64-apple-darwin/SHA256SUMS.part
    21a5c2e69aba46a164425013b0360674d77687dfe8accc8e8cb97dc630542dc1d3  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.dmg
    22cea73001db5a31880ec119f959bb0db21b3f7a12ac21a630b2f12247c4c0b578  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.tar.gz
    238cf6ba1de32f68c70ee23a19fbbeadb59df4c008792c717ac22d476ebe9aa921  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin.tar.gz
    24a05b02f8270bc1928e89ac03d2ab40da9e1fc35cf5416c511fe67a197c64b241  guix-build-b8c146b87720/output/x86_64-linux-gnu/SHA256SUMS.part
    259f213cfc3afb899cf1e06b796f0ab7e4414f60e267f286837d10944c592d0cad  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu-debug.tar.gz
    267f8100bbf4415f4cf531e0b652026e1429877df873bce6b45433e7e1b638efe4  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu.tar.gz
    278d5ad864562ca22a37380a89db7a78574462b78bd74fcf8b663b8164043e800f  guix-build-b8c146b87720/output/x86_64-w64-mingw32/SHA256SUMS.part
    283713b4d70e4eb56b0875d07c698eab270c680da0f81be5394ea16750c5b56490  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-debug.zip
    2925e97d46edb35dd87a55b285dad03a6c571336ab93f8c7457571498e3057118a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-setup-unsigned.exe
    30bc9870404d52a5423ce8fee37cae3ebda00d9958b1469d2930aa8f0d61ab55ef  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-unsigned.tar.gz
    311d78eb522fdebb8e494c63656212972657f323406b43a5f6af835f272529915f  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64.zip
    
  12. 0xB10C commented at 5:03 pm on June 15, 2022: member

    Just a quick note, will review, guix-build, and test more thoroughly:

    Thanks @fanquake! I got the feeling that the motivation for this PR is partially the “full 64-bit RISC-V support” of the SystemTap tooling. We (only) use the includes/sys/sdt.h header file from SystemTap in Bitcoin Core to place information about a tracepoint into an ELF note in the binary. We don’t use other SystemTap tooling.

    As per #23724 (comment) sys/sdt.h in release 4.5 did already support ELF notes for 64-bit RISC-V. I think the “full 64-bit RISC-V support” doesn’t really matter in this context. There is no mention of RISC-V in the commit messages in the includes/sys/sdt.h diff between 4.5 and 4.7.

    git log release-4.5..release-4.7 -- includes/sys/sdt.h

     0
     1commit aa27023c941f88da383e8f2eeec2a81312243e6e
     2Author: Frank Ch. Eigler <fche@redhat.com>
     3Date:   Fri Mar 11 10:29:55 2022 -0500
     4
     5    sys/sdt.h: set x86-64 STAP_SDT_ASM_CONSTRAINT back to "nor"
     6
     7    It turns out the kernel and some other sdt consumers haven't learned
     8    how to use %xmm registers in sdt operands.  So under this duress, stap
     9    will go back to the old school integer register set "nor" as a
    10    default.  We'll revisit this in the future, though this egg might not
    11    turn into a chicken.
    12
    13    https://bugzilla.redhat.com/show_bug.cgi?id=2058908
    14
    15commit 209b5a19c6ee30c2db3f6c849620544a851013e8
    16Author: Stan Cox <scox@redhat.com>
    17Date:   Tue Dec 7 09:55:01 2021 -0500
    18
    19    sys/sdt.h fp constraints: aarch64, s390
    20
    21    Remove float constraints as per commit 1d3653936 but for aarch64 and s390.
    22
    23commit 1d3653936fc1fd13135a723a27e6c7e959793ad0
    24Author: Frank Ch. Eigler <fche@redhat.com>
    25Date:   Mon Dec 6 12:06:06 2021 -0500
    26
    27    sys/sdt.h fp constraints cont'd, x86-64 edition
    28
    29    It appears that various versions of gcc continue to show signs of
    30    confusion at our newly offered asm-operand alternatives for floating
    31    point sdt.h marker parameters.
    32
    33    e.g., https://bugzilla.redhat.com/show_bug.cgi?id=2028798
    34
    35    We may need to restore previous constraints broadly, forcing the
    36    compiler to plop floating point parameters into integer storage.
    37
    38commit ecab2afea46099b4e7dfd551462689224afdbe3a
    39Author: Stan Cox <scox@redhat.com>
    40Date:   Wed Dec 1 16:19:22 2021 -0500
    41
    42    Handle user supplied sdt probe argument template
    43
    44    User supplied templates were erroneously removed by commit eaa15b047,
    45    which complicated the template expansion. To do the above the
    46    expansion of STAP_PROBE_ASM(provider, fooprobe,
    47    STAP_PROBE_ASM_TEMPLATE(3)) adds an unused argument:
    48    STAP_PROBE_ASM(provider, fooprobe, /*template expansion*/ "%[SDT..]..",
    49    "use _SDT_ASM_TEMPLATE") A supplied template
    50    STAP_PROBE_ASM(provider, fooprobe, "4@%rdx 8@%rax") is left alone.  If
    51    the varargs has 2 args (the fake "use ..") then macro expansion
    52    inserts the expanded string, otherwise "4@.." becomes an ascii op.
    53
    54commit 34facf7ee6b43dae66cc109973a4eda42e439163
    55Author: Frank Ch. Eigler <fche@redhat.com>
    56Date:   Wed Dec 1 10:59:27 2021 -0500
    57
    58    RHBZ2026858: on __arm__ (arm32), use STAP_SDT_ARG_CONSTRAINT = g
    59
    60commit b6f7ffb699c08a8ecd0ff97bf828cf55831e2be0
    61Author: Stan Cox <scox@redhat.com>
    62Date:   Fri Oct 8 09:42:47 2021 -0400
    63
    64    Add support for s390 floating point registers
    65
    66    Add float registers.  Add move from float register to general
    67    register.  Allow an sdt argument to be a float register.
    68
    69commit eaa15b047688175a94e3ae796529785a3a0af208
    70Author: Stan Cox <scox@redhat.com>
    71Date:   Thu Sep 30 16:11:29 2021 -0400
    72
    73    PR27829: Support floating point values passed through sdt.h markers
    74
    75    Add the type to the individual arg entries in the .notes.stapsdt section;
    76    currently SP@A, where S is optional '-' sign, P is precision of type and A is
    77    address.  Revised format is SPT@A where T is optional 'f' for float variables.
    78    Add x8664 float registers xmm8 - xmm15 and aarch64 float registers v8 - v31.
    79    Parse the type field; result is currently ignored.  asm statements are
    80    restricted to 30 arguments; sdt probes can have up to 12 arguments.  To fit
    81    this into a single asm statement, precision and type are encoded into a single
    82    field: 0xSSTT where SS is the precision and TT is the type as encoded by
    83    __builtin_classify_type.  The sign S, precision P, and type T are decoded by
    84    _SDT_SIGN, _SDT_SIZE, and _SDT_TYPE.  Test that the revised
    85    .notes.stapsdt section interacts correctly with eu-elfutils and gdb.
    

    Nonetheless, I think keeping dependencies up-to-date is important -> will test/review.

  13. laanwj commented at 5:45 pm on June 15, 2022: member

    As per #23724 (comment) sys/sdt.h in release 4.5 did already support ELF notes for 64-bit RISC-V.

    Whoops, i completely forgot about that. I remember checking this before but i thought it was for a custom build, not GUIX.

    Yes, I don’t think this makes a difference then, in that regard!

  14. 0xB10C commented at 6:20 pm on June 15, 2022: member
    @laanwj I haven’t played around with the SystemTap tooling yet (it has been on my list for a while though). It could be that we can somehow hook into tracepoints with it. As it now has “full RISC-V support” it could work on RISC-V too. I’ll let you know what/how to test once I look into it.
  15. laanwj commented at 7:40 pm on June 15, 2022: member

    I’ll let you know what/how to test once I look into it.

    Thanks!

  16. 0xB10C commented at 9:53 pm on June 15, 2022: member

    The SystemTap language is surprisingly similar to bpftrace, but a bit more powerful! @laanwj I’m able to run stap p2p_messages.stp (as user with privileges) to hook into a running Bitcoin Core process.

    0$ cat p2p_messages.stp
    1probe process("src/bitcoind").provider("net").mark("*bound_message") {
    2  if ($$name == "inbound_message") {
    3    printf ("<-- peer=%d %s\n", $arg1, user_string($arg4))
    4  } else {
    5    printf ("--> peer=%d %s\n", $arg1, user_string($arg4))
    6  }
    7}
    

    produces output similar to:

    0...
    1<-- peer=1 inv
    2--> peer=1 getdata
    3<-- peer=1 tx
    4...
    
  17. laanwj commented at 10:26 am on June 16, 2022: member

    Unfortunately, debian’s version of systemtap is still at 4.6. During build I get all kinds of errors (I guess while trying to build a kernel module?):

    0$ stap p2p_messages.stp
    1/usr/share/systemtap/runtime/transport/relay_v2.c: In function __stp_relay_switch_subbuf:                                                                                                                                         
    2/usr/share/systemtap/runtime/transport/relay_v2.c:69:34: error: invalid use of undefined type struct rchan_buf                                                                                                                    
    3   69 |         if (unlikely(length > buf->chan->subbuf_size))                                                                                                                                                                      
    4      |                                  ^~                                                                                                                                                                                         
    5./include/linux/compiler.h:78:45: note: in definition of macro unlikely                                                                                                                                                           
    6   78 | # define unlikely(x)    __builtin_expect(!!(x), 0)                                                                                                                                                                          
    7      |                                             ^                                                                                                                                                                               
    

    Either I really need 4.7 (will try building from source done, same issue still), or, it may be that my (custom compiled) kernel on this device is lacking some essential config setting. I found this for documentation for running stap against custom-compiled kernels: https://sourceware.org/systemtap/wiki/SystemTapWithSelfBuiltKernel

    I’ll try this later, it’s easy enough to make sure the flags are enabled, but I have some trouble on this device with kernels (newer ones seemed to crash randomly) so I’ve held on to this specific one for a while.

    Edit: yes, I am missing CONFIG_RELAY

  18. laanwj commented at 5:22 am on June 17, 2022: member

    Yess

     0root@loreley:/home/user/test/bitcoin-b8c146b87720/bitcoin# /opt/systemtap/bin/stap p2p_messages.stp
     1--> peer=0 version                                                                                                
     2<-- peer=0 version                                                                                                
     3--> peer=0 wtxidrelay                                                                                             
     4--> peer=0 sendaddrv2                                                                                             
     5--> peer=0 verack                                                                                                 
     6--> peer=0 getaddr                         
     7<-- peer=0 verack                                                                                                                                                                                                                   
     8--> peer=0 sendheaders                                                                                                                                                                                                              
     9--> peer=0 sendcmpct                                                                                                                                                                                                                
    10--> peer=0 ping                                                                                                                                                                                                                     
    11--> peer=0 getheaders                                                                                                                                                                                                               
    12--> peer=0 feefilter                                                                                                                                                                                                                
    

    Recompiling the kernel with RELAY enabled did it.

  19. laanwj commented at 5:40 am on June 17, 2022: member

    Tested ACK b8c146b8772030c6efaac43198c4de0d76fd25af

    It works, but it also worked for the 23.0 RISCV-64 binary I tried it with. No difference in the probes themselves (as expected by @0xB10C ).

  20. laanwj merged this on Jun 17, 2022
  21. laanwj closed this on Jun 17, 2022

  22. fanquake deleted the branch on Jun 17, 2022
  23. 0xB10C commented at 3:21 pm on June 18, 2022: member

    Post merge review:

    • sha256sum for my downloaded systemtap-4.7 matches
    • GUIX hashes match
    • the updated remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch looks OK to me
    • build on x86_64 and aarch64 and checked that tracepoints are compiled in
    • the USDT interface tests pass on x86_64 and aarch64
  24. sidhujag referenced this in commit c7d697c44c on Jun 19, 2022
  25. DrahtBot locked this on Jun 18, 2023


fanquake laanwj DrahtBot jarolrod 0xB10C


laanwj

Labels
Build system

Milestone
24.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-23 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me