Blob Blame History Raw
diff -Naurp pcp-3.12.2.orig/src/pmlogextract/pmlogextract.c pcp-3.12.2/src/pmlogextract/pmlogextract.c
--- pcp-3.12.2.orig/src/pmlogextract/pmlogextract.c	2017-10-03 07:46:36.000000000 +1100
+++ pcp-3.12.2/src/pmlogextract/pmlogextract.c	2017-11-29 14:07:06.674837371 +1100
@@ -1108,6 +1108,7 @@ nextmeta(void)
 {
     int		i;
     int		j;
+    int		type;
     int		want;
     int		numeof = 0;
     int		sts;
@@ -1158,10 +1159,12 @@ againmeta:
 	    continue;
 	}
 
+	type = ntohl(iap->pb[META][1]);
+
 	/* pmDesc entries, if not seen before & wanted,
 	 *	then append to desc list
 	 */
-	if (ntohl(iap->pb[META][1]) == TYPE_DESC) {
+	if (type == TYPE_DESC) {
 	    pmid = ntoh_pmID(iap->pb[META][2]);
 
 	    /* if ml is defined, then look for pmid in the list
@@ -1194,7 +1197,7 @@ againmeta:
 		goto againmeta;
 	    }
 	}
-	else if (ntohl(iap->pb[META][1]) == TYPE_INDOM) {
+	else if (type == TYPE_INDOM) {
 	    /* if ml is defined, then look for instance domain in the list
 	     * if indom is not in the list then discard it immediately
 	     */
@@ -1227,15 +1230,25 @@ againmeta:
 	        goto againmeta;
 	    }
 	}
-	else if (ntohl(iap->pb[META][1]) == 3 /*TYPE_LABEL*/) {
-	    /* discard this optional metadata, not supported */
+	else if (type == 3 /*TYPE_LABEL*/) {
+	    if (pmDebugOptions.logmeta)
+		fprintf(stderr, "%s: Warning: %s\n",
+			pmProgname, pmErrStr(PM_ERR_NYI));
+	    free(iap->pb[META]);
+	    iap->pb[META] = NULL;
+	    goto againmeta;
+	}
+	else if (type == 4 /*TYPE_TEXT*/) {
+	    if (pmDebugOptions.logmeta)
+		fprintf(stderr, "%s: Warning: %s\n",
+			pmProgname, pmErrStr(PM_ERR_NYI));
 	    free(iap->pb[META]);
 	    iap->pb[META] = NULL;
 	    goto againmeta;
 	}
 	else {
 	    fprintf(stderr, "%s: Error: unrecognised meta data type: %d\n",
-		    pmProgname, (int)ntohl(iap->pb[META][1]));
+		    pmProgname, type);
 	    abandon_extract();
 	}
 
diff -Naurp pcp-3.12.2.orig/src/pmlogrewrite/pmlogrewrite.c pcp-3.12.2/src/pmlogrewrite/pmlogrewrite.c
--- pcp-3.12.2.orig/src/pmlogrewrite/pmlogrewrite.c	2017-10-03 07:46:36.000000000 +1100
+++ pcp-3.12.2/src/pmlogrewrite/pmlogrewrite.c	2017-11-29 14:06:25.421841627 +1100
@@ -1220,7 +1220,14 @@ main(int argc, char **argv)
 		do_indom();
 	    }
 	    else if (stsmeta == 3 /*TYPE_LABEL*/) {
-		;	/* silently ignore optional metadata */
+		if (pmDebugOptions.logmeta)
+		    fprintf(stderr, "%s: Warning: %s\n",
+			    pmProgname, pmErrStr(PM_ERR_NYI));
+	    }
+	    else if (stsmeta == 4 /*TYPE_TEXT*/) {
+		if (pmDebugOptions.logmeta)
+		    fprintf(stderr, "%s: Warning: %s\n",
+			    pmProgname, pmErrStr(PM_ERR_NYI));
 	    }
 	    else {
 		fprintf(stderr, "%s: Error: unrecognised meta data type: %d\n",