Index: trunk/include/iprt/mangling.h
===================================================================
--- trunk/include/iprt/mangling.h	(revision 85948)
+++ trunk/include/iprt/mangling.h	(revision 85949)
@@ -2622,4 +2622,6 @@
 # define RTTraceLogRdrEvtGetTs                          RT_MANGLER(RTTraceLogRdrEvtGetTs)
 # define RTTraceLogRdrEvtIsGrouped                      RT_MANGLER(RTTraceLogRdrEvtIsGrouped)
+# define RTTraceLogRdrEvtMapToStruct                    RT_MANGLER(RTTraceLogRdrEvtMapToStruct)
+# define RTTraceLogRdrEvtMapFree                        RT_MANGLER(RTTraceLogRdrEvtMapFree)
 # define RTTraceLogRdrEvtPoll                           RT_MANGLER(RTTraceLogRdrEvtPoll)
 # define RTTraceLogRdrEvtQueryVal                       RT_MANGLER(RTTraceLogRdrEvtQueryVal)
Index: trunk/include/iprt/tracelog.h
===================================================================
--- trunk/include/iprt/tracelog.h	(revision 85948)
+++ trunk/include/iprt/tracelog.h	(revision 85949)
@@ -214,4 +214,60 @@
 
 
+/**
+ * Item mapping descriptor.
+ */
+typedef struct RTTRACELOGRDRMAPITEM
+{
+    /** The item name. */
+    const char                  *pszName;
+    /** The value type to map the item to. */
+    RTTRACELOGTYPE              enmType;
+} RTTRACELOGRDRMAPITEM;
+/** Pointer to a mapping item descriptor. */
+typedef RTTRACELOGRDRMAPITEM *PRTTRACELOGRDRMAPITEM;
+/** Pointer to a const mapping item descriptor. */
+typedef const RTTRACELOGRDRMAPITEM *PCRTTRACELOGRDRMAPITEM;
+
+
+/**
+ * Event item to value mapping descriptor for RTTraceLogRdrEvtMapToStruct().
+ */
+typedef struct RTTRACELOGRDRMAPDESC
+{
+    /** The event ID this mapping describes. */
+    const char                  *pszEvtId;
+    /** Number of event items to extract. */
+    uint32_t                    cEvtItems;
+    /** Pointer to the event items to extract (in the given order). */
+    PCRTTRACELOGRDRMAPITEM      paMapItems;
+} RTTRACELOGRDRMAPDESC;
+/** Pointer to a event mapping descriptor. */
+typedef RTTRACELOGRDRMAPDESC *PRTTRACELOGRDRMAPDESC;
+/** Pointer to a const event mapping descriptor. */
+typedef const RTTRACELOGRDRMAPDESC *PCRTTRACELOGRDRMAPDESC;
+
+
+/**
+ * Header for an event mapped to a binary.
+ */
+typedef struct RTTRACELOGRDREVTHDR
+{
+    /** The mapping descriptor this event was mapped to. */
+    PCRTTRACELOGRDRMAPDESC      pEvtMapDesc;
+    /** The event descriptor as extracted from the event log. */
+    PCRTTRACELOGEVTDESC         pEvtDesc;
+    /** Sequence number of the descriptor. */
+    uint64_t                    idSeqNo;
+    /** The timestamp of the event. */
+    uint64_t                    tsEvt;
+    /** Pointer to the event data items. */
+    PCRTTRACELOGEVTVAL          paEvtItems;
+} RTTRACELOGRDREVTHDR;
+/** Pointer to an event header. */
+typedef RTTRACELOGRDREVTHDR *PRTTRACELOGRDREVTHDR;
+/** Pointer to a const event header. */
+typedef const RTTRACELOGRDREVTHDR *PCRTTRACELOGRDREVTHDR;
+
+
 /** Event group ID. */
 typedef uint64_t                   RTTRACELOGEVTGRPID;
@@ -517,4 +573,31 @@
 
 /**
+ * Extracts the given number of events from the given trace log reader instance returning
+ * and array of events with the values filled in from the mapping descriptor.
+ *
+ * @returns IPRT status code.
+ * @param   hTraceLogRdr        The trace log reader instance handle.
+ * @param   fFlags              Flags controlling the behavior, MBZ.
+ * @param   cEvts               Number of events to extract, UINT32_MAX to map all immediately available events.
+ * @param   paMapDesc           Pointer to an array of mapping descriptors describing how to map events.
+ * @param   ppaEvtHdr           Where to return the pointer to the allocated array of event headers on success.
+ * @param   pcEvts              Where to store the returned number of events on success.
+ */
+RTDECL(int) RTTraceLogRdrEvtMapToStruct(RTTRACELOGRDR hTraceLogRdr, uint32_t fFlags, uint32_t cEvts,
+                                        PCRTTRACELOGRDRMAPDESC paMapDesc, PCRTTRACELOGRDREVTHDR *ppaEvtHdr,
+                                        uint32_t *pcEvts);
+
+
+/**
+ * Frees all resources of the given array of event headers as allocated by RTTraceLogRdrEvtMapToStruct().
+ *
+ * @returns nothing.
+ * @param   paEvtHdr            Pointer to the array of events as returned by RTTraceLogRdrEvtMapToStruct().
+ * @param   cEvts               Number of events as returned by RTTraceLogRdrEvtMapToStruct().
+ */
+RTDECL(void) RTTraceLogRdrEvtMapFree(PCRTTRACELOGRDREVTHDR paEvtHdr, uint32_t cEvts);
+
+
+/**
  * Frees a previously created iterator.
  *
Index: trunk/src/VBox/Runtime/common/log/tracelogreader.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/log/tracelogreader.cpp	(revision 85948)
+++ trunk/src/VBox/Runtime/common/log/tracelogreader.cpp	(revision 85949)
@@ -1202,5 +1202,5 @@
  * @param   ppEvtItemDesc       Where to store the event item descriptor.
  */
-static int rtTraceLogRdrEvtResolveData(PRTTRACELOGRDREVTINT pEvt, const char *pszName, uint32_t *poffData,
+static int rtTraceLogRdrEvtResolveData(PCRTTRACELOGRDREVTINT pEvt, const char *pszName, uint32_t *poffData,
                                        size_t *pcbEvtData, PPCRTTRACELOGEVTITEMDESC ppEvtItemDesc)
 {
@@ -1238,9 +1238,9 @@
  * @param   pVal                The value to fill.
  */
-static int rtTraceLogRdrEvtFillVal(PRTTRACELOGRDREVTINT pEvt, uint32_t offData, size_t cbData, PCRTTRACELOGEVTITEMDESC pEvtItemDesc,
+static int rtTraceLogRdrEvtFillVal(PCRTTRACELOGRDREVTINT pEvt, uint32_t offData, size_t cbData, PCRTTRACELOGEVTITEMDESC pEvtItemDesc,
                                    PRTTRACELOGEVTVAL pVal)
 {
     PRTTRACELOGRDRINT pThis = pEvt->pRdr;
-    uint8_t *pbData = &pEvt->abEvtData[offData];
+    const uint8_t *pbData = &pEvt->abEvtData[offData];
 
     pVal->pItemDesc = pEvtItemDesc;
@@ -1452,4 +1452,78 @@
 
     return VINF_SUCCESS;
+}
+
+
+/**
+ * Finds the mapping descriptor for the given event.
+ *
+ * @returns Pointer to the mapping descriptor or NULL if not found.
+ * @param   paMapDesc           Pointer to the array of mapping descriptors.
+ * @param   pEvt                The event to look for the matching mapping descriptor.
+ */
+static PCRTTRACELOGRDRMAPDESC rtTraceLogRdrMapDescFindForEvt(PCRTTRACELOGRDRMAPDESC paMapDesc, PCRTTRACELOGRDREVTINT pEvt)
+{
+    AssertPtrReturn(paMapDesc, NULL);
+    AssertPtrReturn(pEvt, NULL);
+
+    while (paMapDesc->pszEvtId)
+    {
+        if (!RTStrCmp(paMapDesc->pszEvtId, pEvt->pEvtDesc->EvtDesc.pszId))
+            return paMapDesc;
+
+        paMapDesc++;
+    }
+
+    return NULL;
+}
+
+
+/**
+ * Fills the given event header with data from the given event using the matching mapping descriptor.
+ *
+ * @returns IPRT statsu code.
+ * @param   pEvtHdr             The event header to fill.
+ * @param   pMapDesc            The mapping descriptor to use.
+ * @param   pEvt                The raw event to get the data from.
+ */
+static int rtTraceLogRdrMapFillEvt(PRTTRACELOGRDREVTHDR pEvtHdr, PCRTTRACELOGRDRMAPDESC pMapDesc, PCRTTRACELOGRDREVTINT pEvt)
+{
+    int rc = VINF_SUCCESS;
+
+    /* Fill in the status parts. */
+    pEvtHdr->pEvtMapDesc = pMapDesc;
+    pEvtHdr->pEvtDesc    = &pEvt->pEvtDesc->EvtDesc;
+    pEvtHdr->idSeqNo     = pEvt->u64SeqNo;
+    pEvtHdr->tsEvt       = pEvt->u64Ts;
+    pEvtHdr->paEvtItems  = NULL;
+
+    /* Now the individual items if any. */
+    if (pMapDesc->cEvtItems)
+    {
+        /* Allocate values for the items. */
+        pEvtHdr->paEvtItems = (PCRTTRACELOGEVTVAL)RTMemAllocZ(pMapDesc->cEvtItems * sizeof(RTTRACELOGEVTVAL));
+        if (RT_LIKELY(pEvtHdr->paEvtItems))
+        {
+            for (uint32_t i = 0; (i < pMapDesc->cEvtItems) && RT_SUCCESS(rc); i++)
+            {
+                uint32_t offData = 0;
+                size_t cbData = 0;
+                PCRTTRACELOGEVTITEMDESC pEvtItemDesc = NULL;
+                rc = rtTraceLogRdrEvtResolveData(pEvt, pMapDesc->paMapItems[i].pszName, &offData, &cbData, &pEvtItemDesc);
+                if (RT_SUCCESS(rc))
+                    rc = rtTraceLogRdrEvtFillVal(pEvt, offData, cbData, pEvtItemDesc, (PRTTRACELOGEVTVAL)&pEvtHdr->paEvtItems[i]);
+            }
+
+            if (RT_FAILURE(rc))
+            {
+                RTMemFree((void *)pEvtHdr->paEvtItems);
+                pEvtHdr->paEvtItems = NULL;
+            }
+        }
+        else
+            rc = VERR_NO_MEMORY;
+    }
+
+    return rc;
 }
 
@@ -1619,4 +1693,89 @@
 
 
+RTDECL(int) RTTraceLogRdrEvtMapToStruct(RTTRACELOGRDR hTraceLogRdr, uint32_t fFlags, uint32_t cEvts,
+                                        PCRTTRACELOGRDRMAPDESC paMapDesc, PCRTTRACELOGRDREVTHDR *ppaEvtHdr,
+                                        uint32_t *pcEvts)
+{
+    RT_NOREF(fFlags);
+
+    PRTTRACELOGRDRINT pThis = hTraceLogRdr;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertPtrReturn(paMapDesc, VERR_INVALID_PARAMETER);
+    AssertPtrReturn(ppaEvtHdr, VERR_INVALID_POINTER);
+    AssertPtrReturn(pcEvts, VERR_INVALID_POINTER);
+
+    int rc = VINF_SUCCESS;
+    uint32_t cEvtsAlloc = cEvts != UINT32_MAX ? cEvts : _4K;
+    PRTTRACELOGRDREVTHDR paEvtHdr = (PRTTRACELOGRDREVTHDR)RTMemAllocZ(cEvtsAlloc * sizeof(*paEvtHdr));
+    if (RT_LIKELY(paEvtHdr))
+    {
+        uint32_t cEvtsRecv = 0;
+
+        while (   RT_SUCCESS(rc)
+               && cEvtsRecv < cEvts)
+        {
+            RTTRACELOGRDRPOLLEVT enmEvt = RTTRACELOGRDRPOLLEVT_INVALID;
+            rc = RTTraceLogRdrEvtPoll(pThis, &enmEvt, 0 /*cMsTimeout*/);
+            if (   RT_SUCCESS(rc)
+                && enmEvt == RTTRACELOGRDRPOLLEVT_TRACE_EVENT_RECVD)
+            {
+                /* Find the mapping descriptor. */
+                PRTTRACELOGRDREVTINT pEvt = NULL;
+                rc = RTTraceLogRdrQueryLastEvt(hTraceLogRdr, &pEvt);
+                if (RT_SUCCESS(rc))
+                {
+                    PCRTTRACELOGRDRMAPDESC pMapDesc = rtTraceLogRdrMapDescFindForEvt(paMapDesc, pEvt);
+                    if (pMapDesc)
+                    {
+                        if (cEvtsRecv == cEvtsAlloc)
+                        {
+                            Assert(cEvts == UINT32_MAX);
+                            PRTTRACELOGRDREVTHDR paEvtHdrNew = (PRTTRACELOGRDREVTHDR)RTMemRealloc(paEvtHdr, (cEvtsAlloc + _4K) * sizeof(*paEvtHdr));
+                            if (RT_LIKELY(paEvtHdrNew))
+                            {
+                                paEvtHdr = paEvtHdrNew;
+                                cEvtsAlloc += _4K;
+                            }
+                            else
+                                rc = VERR_NO_MEMORY;
+                        }
+
+                        if (RT_SUCCESS(rc))
+                            rc = rtTraceLogRdrMapFillEvt(&paEvtHdr[cEvtsRecv++], pMapDesc, pEvt);
+                        cEvtsRecv++;
+                    }
+                    else
+                        rc = VERR_NOT_FOUND;
+                }
+            }
+        }
+
+        if (RT_SUCCESS(rc))
+        {
+            *ppaEvtHdr = paEvtHdr;
+            *pcEvts    = cEvtsRecv;
+        }
+        else
+            RTTraceLogRdrEvtMapFree(paEvtHdr, cEvtsRecv);
+    }
+    else
+        rc = VERR_NO_MEMORY;
+
+    return rc;
+}
+
+
+RTDECL(void) RTTraceLogRdrEvtMapFree(PCRTTRACELOGRDREVTHDR paEvtHdr, uint32_t cEvts)
+{
+    for (uint32_t i = 0; i < cEvts; i++)
+    {
+        if (paEvtHdr[i].paEvtItems)
+            RTMemFree((void *)paEvtHdr[i].paEvtItems);
+    }
+
+    RTMemFree((void *)paEvtHdr);
+}
+
+
 RTDECL(void) RTTraceLogRdrIteratorFree(RTTRACELOGRDRIT hIt)
 {
