Giter Site home page Giter Site logo

Comments (2)

rosenbaumalex avatar rosenbaumalex commented on June 29, 2024

once you export 'LD_PRELOAD=libvma.so' to the shell, all following commands will get executed and run while loading VMA to the process's memory space. I'm guessing that that was not your intention.
So in your case above you dynamically loaded VMA into GDB memory space.
I don't know why it failed. We'll need to check that.

if you want to debug your './client_vma' with VMA then you need to use 'set environment LD_PRELOAD=libvma.so' in the gdb shell.
You might also need to specify the solib search path with '_gdb solib-search-path '.

Example:

$ gdb sockperf
(gdb) set args server
(gdb) set environment LD_PRELOAD=libvma.so
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/sockperf server
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 7.0.14-0 Release built on Jan 28 2016 21:08:18
 VMA INFO: Cmd Line: /bin/bash -c exec /usr/bin/sockperf server
 VMA INFO: OFED Version: MLNX_OFED_LINUX-3.2-1.0.1.1:
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 7.0.14-0 Release built on Jan 28 2016 21:08:18
 VMA INFO: Cmd Line: /usr/bin/sockperf server
Detaching after fork from child process 15429.
 VMA INFO: OFED Version: MLNX_OFED_LINUX-3.2-1.0.1.1:
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
[New Thread 0x7ffff61f4700 (LWP 15433)]
sockperf: == version #2.7-43.git3ee62bd8107a == 
sockperf: [SERVER] listen on:
[ 0] IP = 0.0.0.0         PORT = 11111 # UDP
sockperf: Warmup stage (sending a few dummy messages)...
sockperf: [tid 15420] using recvfrom() to block on socket(s)

please tell me if this solves your debugging issue.

from libvma.

vikramsc avatar vikramsc commented on June 29, 2024

Thanks a lot for the details.. Specified steps worked for me.

$ gdb ./client_vma
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./client_vma...done.
(gdb) set args 192.168.1.1 8000 1024 10 100
(gdb) set environment LD_PRELOAD=libvma.so
(gdb) r
Starting program: /home/dce/vikram/client_vma 192.168.1.1 8000 1024 10 100
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 7.0.14-0 Release built on Jan 28 2016 20:41:00
 VMA INFO: Cmd Line: /bin/bash -c exec /home/dce/vikram/client_vma 192.168.1.1 8000 1024 10 100
 VMA INFO: OFED Version: MLNX_OFED_LINUX-3.2-1.0.1.1:
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 7.0.14-0 Release built on Jan 28 2016 20:41:00
 VMA INFO: Cmd Line: /home/dce/vikram/client_vma 192.168.1.1 8000 1024 10 100
 VMA INFO: OFED Version: MLNX_OFED_LINUX-3.2-1.0.1.1:
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
[New Thread 0x7ffff61eb700 (LWP 8716)]
Buf[0] sent (Total data sent: 1024)
Buf[1] sent (Total data sent: 2048)
Buf[2] sent (Total data sent: 3072)
Buf[3] sent (Total data sent: 4096)
Buf[4] sent (Total data sent: 5120)
Buf[5] sent (Total data sent: 6144)
Buf[6] sent (Total data sent: 7168)
Buf[7] sent (Total data sent: 8192)
Buf[8] sent (Total data sent: 9216)
Buf[9] sent (Total data sent: 10240)
##Overall Total data sent = 10240 bytes 
[Thread 0x7ffff61eb700 (LWP 8716) exited]
[Inferior 1 (process 8704) exited normally]
(gdb) quit
$ gdb ./server_vma_zcopy
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./server_vma_zcopy...done.
(gdb) set args 192.168.1.1 8000
(gdb) set environment LD_PRELOAD=libvma.so
(gdb) r
Starting program: /home/dce/vikram/tmp/vikram/libvma_examples/server_vma_zcopy 192.168.1.1 8000
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 7.0.14-0 Release built on Jan 28 2016 20:41:00
 VMA INFO: Cmd Line: /bin/bash -c exec /home/dce/vikram/tmp/vikram/libvma_examples/server_vma_zcopy 192.168.1.1 8000
 VMA INFO: OFED Version: MLNX_OFED_LINUX-3.2-1.0.1.1:
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 VMA INFO: ---------------------------------------------------------------------------
 VMA INFO: VMA_VERSION: 7.0.14-0 Release built on Jan 28 2016 20:41:00
 VMA INFO: Cmd Line: /home/dce/vikram/tmp/vikram/libvma_examples/server_vma_zcopy 192.168.1.1 8000
 VMA INFO: OFED Version: MLNX_OFED_LINUX-3.2-1.0.1.1:
 VMA INFO: Log Level                      INFO                       [VMA_TRACELEVEL]
 VMA INFO: ---------------------------------------------------------------------------
[New Thread 0x7ffff61eb700 (LWP 34733)]
Accepted connection on descriptor 23 (host=192.168.1.2, port=52799)
Total Data Recieved [socketfd: 23]: Based on iovec: 2048 bytes,  Based on return value: 2048 bytes
Total Data Recieved [socketfd: 23]: Based on iovec: 3508 bytes,  Based on return value: 3508 bytes
Total Data Recieved [socketfd: 23]: Based on iovec: 6428 bytes,  Based on return value: 6428 bytes
Total Data Recieved [socketfd: 23]: Based on iovec: 7888 bytes,  Based on return value: 7888 bytes
## ERROR: Datalen from vma_packet's iovec: 893 != Return value from recvfrom_zcopy: 2352 !!!
Total Data Recieved [socketfd: 23]: Based on iovec: 8781 bytes,  Based on return value: 10240 bytes

from libvma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.