Yet another question. Associated with "Re: Shared library"

Christian Helmuth christian.helmuth at ...1...
Fri Mar 5 12:11:44 CET 2010


Peter,

I have the feeling you're mixing two distinct matters here. The issue
Norman addressed in his email was "How to share memory buffers between
applications". That is done via dataspaces that are referenced by
dataspace capabilities (in Unix file descriptors) and could be
attached to any virtual address space via region management (in Unix
mmap()).

Beside this you try to implement your sampling code as a library, which
is perfect, but is more about "How to integrate your own library into
Genode". You may read doc/getting_started.txt "Creating targets and
libraries" to learn more about Genode's build system design.

On Fri, Mar 05, 2010 at 03:23:24PM +1030, Peter Nguyen wrote:
[...]
> However, the data in the library isn't shared between the two
> components.

What do you want to say with this statement? Do you want the data to
be shared? Do you want to prevent sharing of the data (which is
perfectly achieved with shared libraries that only share the read-only
segements http://en.wikipedia.org/wiki/Library_%28computing%29#Shared_libraries)? 

> In order for me to share the buffer data with the profiling environment, 
> I'm thinking that I would need to know the ID of the network sampling 
> handler thread (that commences the reading of samples from the buffer) 
> ahead of time, and supply the address of the dataspace to the network 
> sampling thread.

I propose to implement the "network sampling thread" in a profiling
"server" that announces its "service" and provides "sessions" to its
"clients" (e.g., the HTTP server). On startup, the client requests a
"session" to "profiling" from its parent. Thereafter, it requests the
dataspace capability via the "profiling session" interface and
attaches the dataspace locally. The resulting virtual start address
can be used to initilialize your sampling "library".

Furthermore, I would use our signalling framework to signal events
regarding the sampling buffer from client to server.

> Infact, i'm thinking the easiest way to get around my issue is probably 
> having to integrate the sampling functionality into the HTTP server eg. 
> having my source code in the same directory as the HTTP server. This 
> isn't really an ideal situation, and i'd like to avoid this if possible. 
> But if this is the only way, then I really have no choice obviously.

Please give it another try with the hints I gave above. There's no
need to colocate your profiling server and the monitored application.
I suggest to read the documentation available at the project website

  http://genode.org/documentation

to get a good feeling how Genode works and how it's different from
Posix.

Regards
-- 
Christian Helmuth
Genode Labs

http://www.genode-labs.com/ · http://genode.org/

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list