Index: /trunk/include/VBox/vmm/pdmdev.h
===================================================================
--- /trunk/include/VBox/vmm/pdmdev.h	(revision 88305)
+++ /trunk/include/VBox/vmm/pdmdev.h	(revision 88306)
@@ -2349,5 +2349,5 @@
 
 /** Current PDMDEVHLPR3 version number. */
-#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 47, 0)
+#define PDM_DEVHLPR3_VERSION                    PDM_VERSION_MAKE_PP(0xffe7, 47, 1)
 
 /**
@@ -4262,5 +4262,14 @@
     /** Space reserved for future members.
      * @{ */
-    DECLR3CALLBACKMEMBER(void, pfnReserved1,(void));
+    /**
+     * Deregister zero or more samples given their name prefix.
+     *
+     * @returns VBox status code.
+     * @param   pDevIns     The device instance.
+     * @param   pszPrefix   The name prefix of the samples to remove.  If this does
+     *                      not start with a '/', the default prefix will be
+     *                      prepended, otherwise it will be used as-is.
+     */
+    DECLR3CALLBACKMEMBER(int, pfnSTAMDeregisterByPrefix,(PPDMDEVINS pDevIns, const char *pszPrefix));
     DECLR3CALLBACKMEMBER(void, pfnReserved2,(void));
     DECLR3CALLBACKMEMBER(void, pfnReserved3,(void));
@@ -6855,4 +6864,12 @@
 
 /**
+ * @copydoc PDMDEVHLPR3::pfnSTAMDeregisterByPrefix
+ */
+DECLINLINE(int) PDMDevHlpSTAMDeregisterByPrefix(PPDMDEVINS pDevIns, const char *pszPrefix)
+{
+    return pDevIns->pHlpR3->pfnSTAMDeregisterByPrefix(pDevIns, pszPrefix);
+}
+
+/**
  * Registers the device with the default PCI bus.
  *
Index: /trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp	(revision 88305)
+++ /trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp	(revision 88306)
@@ -1298,4 +1298,33 @@
     }
     AssertRC(rc);
+}
+
+
+/**
+ * @interface_method_impl{PDMDEVHLPR3,pfnSTAMDeregisterByPrefix}
+ */
+static DECLCALLBACK(int) pdmR3DevHlp_STAMDeregisterByPrefix(PPDMDEVINS pDevIns, const char *pszPrefix)
+{
+    PDMDEV_ASSERT_DEVINS(pDevIns);
+    PVM pVM = pDevIns->Internal.s.pVMR3;
+    VM_ASSERT_EMT(pVM);
+
+    int rc;
+    if (*pszPrefix == '/')
+        rc = STAMR3DeregisterByPrefix(pVM->pUVM, pszPrefix);
+    else
+    {
+        char    szQualifiedPrefix[1024];
+        ssize_t cch;
+        if (pDevIns->pReg->cMaxInstances == 1)
+            cch = RTStrPrintf2(szQualifiedPrefix, sizeof(szQualifiedPrefix), "/Devices/%s/%s", pDevIns->pReg->szName, pszPrefix);
+        else
+            cch = RTStrPrintf2(szQualifiedPrefix, sizeof(szQualifiedPrefix), "/Devices/%s#%u/%s",
+                               pDevIns->pReg->szName, pDevIns->iInstance, pszPrefix);
+        AssertReturn(cch > 0, VERR_OUT_OF_RANGE);
+        rc = STAMR3DeregisterByPrefix(pVM->pUVM, szQualifiedPrefix);
+    }
+    AssertRC(rc);
+    return rc;
 }
 
@@ -4411,5 +4440,5 @@
     pdmR3DevHlp_CpuGetGuestMicroarch,
     pdmR3DevHlp_CpuGetGuestAddrWidths,
-    0,
+    pdmR3DevHlp_STAMDeregisterByPrefix,
     0,
     0,
@@ -4759,5 +4788,5 @@
     pdmR3DevHlp_CpuGetGuestMicroarch,
     pdmR3DevHlp_CpuGetGuestAddrWidths,
-    0,
+    pdmR3DevHlp_STAMDeregisterByPrefix,
     0,
     0,
@@ -5264,5 +5293,5 @@
     pdmR3DevHlp_CpuGetGuestMicroarch,
     pdmR3DevHlp_CpuGetGuestAddrWidths,
-    0,
+    pdmR3DevHlp_STAMDeregisterByPrefix,
     0,
     0,
