Hello Jakub, On Fri, Jul 3, 2020 at 10:40 AM Jakub Jelinek <ja...@redhat.com> wrote:
> On Fri, Jul 03, 2020 at 10:26:27AM -0400, y2s1982 . wrote: > > Still, following the documentation 5.5.2.1, how should I extract version > > information from ompd_address_space_context_t that is owned by the > > debugger instead of the OMPD to check for compatibility , especially > > when it is not currently defined? > > For ompd_process_initialize, you can use the callbacks to find out anything > you want. > In particular, e.g. ompd_callback_symbol_addr_fn_t callback can be used to > look up some magic symbol that you'd add to libgomp.so.1 > (GOMP_library_details or whatever else), which would be some (ideally > read-only) data variable that will describe everything OMPD needs to know > about the library; if that symbol isn't found, you'd say it is > incompatible, > if it is found, you'd read it and parse it. > Thank you for clarifying how ompd_callback_symbol_addr_fn_t callback can used. Are there any existing symbols I can lookup using this function and the current libgomp.so.1, such as information on cuda device id? > It would be nice if the variable contains data in some extensible format, > which would allow for compatible (one version of libgompd.so.1 handling > older or newer libgomp.so.1) or incompatible (something OMPD will not be > able to deal with) changes and encode everything you'll need to know > (offsets into internal structures where needed, their sizes, etc.) in some > compact form. You can use the ompd_callback_memory_read_fn_t callback > to read data from that variable. What kind of information should I put in? At the moment, I am thinking of creating a packet with following memory structure: a header portion of one byte that represents the total byte size of the encoded packet, followed by a series of bits, each representing compatibility of a particular OMPD version. I would then use an enum with specific numerical values representing each OMPD version to bitshift or otherwise represent the version. Is this a correct direction of thought? > > Jakub > >