X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fgator%2Fdaemon%2FCapturedXML.cpp;h=4a11415a00c978bfe9be2d350d4e95644522c3dd;hb=e31266f78058409d18d48e0afa8339e77322b17f;hp=cf79b72a1166966a2e1f71d0aff8a26a7befa59a;hpb=15ce78dafc08b1c5c3ec8f42070ae37160b5154c;p=firefly-linux-kernel-4.4.55.git diff --git a/tools/gator/daemon/CapturedXML.cpp b/tools/gator/daemon/CapturedXML.cpp index cf79b72a1166..4a11415a00c9 100644 --- a/tools/gator/daemon/CapturedXML.cpp +++ b/tools/gator/daemon/CapturedXML.cpp @@ -33,7 +33,7 @@ mxml_node_t* CapturedXML::getTree(bool includeTime) { captured = mxmlNewElement(xml, "captured"); mxmlElementSetAttr(captured, "version", "1"); if (gSessionData->perf.isSetup()) { - mxmlElementSetAttr(captured, "type", "Perf"); + mxmlElementSetAttr(captured, "type", "Perf"); } mxmlElementSetAttrf(captured, "protocol", "%d", PROTOCOL_VERSION); if (includeTime) { // Send the following only after the capture is complete @@ -66,10 +66,15 @@ mxml_node_t* CapturedXML::getTree(bool includeTime) { mxml_node_t *const node = mxmlNewElement(counters, "counter"); mxmlElementSetAttrf(node, "key", "0x%x", counter.getKey()); mxmlElementSetAttr(node, "type", counter.getType()); - mxmlElementSetAttrf(node, "event", "0x%x", counter.getEvent()); + if (counter.getEvent() != -1) { + mxmlElementSetAttrf(node, "event", "0x%x", counter.getEvent()); + } if (counter.getCount() > 0) { mxmlElementSetAttrf(node, "count", "%d", counter.getCount()); } + if (counter.getCores() > 0) { + mxmlElementSetAttrf(node, "cores", "%d", counter.getCores()); + } } } @@ -89,7 +94,7 @@ void CapturedXML::write(char* path) { // Set full path snprintf(file, PATH_MAX, "%s/captured.xml", path); - + char* xml = getXML(true); if (util->writeToDisk(file, xml) < 0) { logg->logError(__FILE__, __LINE__, "Error writing %s\nPlease verify the path.", file);