You are not logged in.

#1 2014-06-20 11:47:09

bz1pp3d
Member
Registered: 2008-11-25
Posts: 21

Debugging Interprocess Communication

Hi, guys! I want to ask a question, that bother me a while. Let's say that we have 3 processes that communicate with each other with sockets/pipes. In a very small time, e.g. in nanoseconds, each of the process sends and receives a message from his neighbors.  Is it possible to examine the order of which messages are sent first, second... and so on?
The code is written in C.
I've tried using gdb to attach to each of the process, but sooner or later I've got a SIGTRAP and no luck at all.

Any ideas?

Offline

#2 2014-06-20 15:39:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,722

Re: Debugging Interprocess Communication

Are you trying to determine the sequencing and contents of the messages, or are you trying to instrument the latency of the messages.  BTW, I think you are off by at least 4 orders of magnitude on your time base. tongue

You might set up a "Man in the Middle" who listens on one pipe, logs the data, and forwards it down a different pipe.   The problem is that the processes are mutually asynchronous, as is your man in the middle, and the kernel which is running the pipes.  So, unless the protocol has some kind of, "Here is my message, over to you" followed by a "Roger, copy that" response, it is possible that messages will pass each other going in different directions.  Determining who knew what when in these situations is a tough problem.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2014-06-23 06:41:09

bz1pp3d
Member
Registered: 2008-11-25
Posts: 21

Re: Debugging Interprocess Communication

Well, I try to determine the sequencing of the messages, and it's about openbgpd. Why I have to do that: I experiance some network issues with missing routes and this kind of stuff. I have to examine the sequence of messages, if I want to fix these bugs. I'm thinkig of dumping each function call with extra time field - these who handle messages and these who send messages, in separate files, and then using some scripting to sort it.
The problem is, IMO, that the messages are relayed to from user space to kernel space and the messages will be not proper ordered.

Offline

Board footer

Powered by FluxBB