Skip to content

Commit 02c007a

Browse files
committed
libpcp: further refinements to dup instance label logging
Related to Red Hat bug RHEL-67227
1 parent 24ed01c commit 02c007a

File tree

3 files changed

+12
-54
lines changed

3 files changed

+12
-54
lines changed

qa/1368.out

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,6 @@ Metric Labels in the Log ...
3434
[0] name(2,3) : value(7,3) [instances]
3535
InDom 29.2[900] labels (11 bytes): {"bin":900}
3636
[0] name(2,3) : value(7,3) [instances]
37-
InDom 29.2[100] labels (11 bytes): {"bin":100}
38-
[0] name(2,3) : value(7,3) [instances]
39-
InDom 29.2[200] labels (11 bytes): {"bin":200}
40-
[0] name(2,3) : value(7,3) [instances]
41-
InDom 29.2[300] labels (11 bytes): {"bin":300}
42-
[0] name(2,3) : value(7,3) [instances]
43-
InDom 29.2[400] labels (11 bytes): {"bin":400}
44-
[0] name(2,3) : value(7,3) [instances]
45-
InDom 29.2[500] labels (11 bytes): {"bin":500}
46-
[0] name(2,3) : value(7,3) [instances]
47-
InDom 29.2[600] labels (11 bytes): {"bin":600}
48-
[0] name(2,3) : value(7,3) [instances]
49-
InDom 29.2[700] labels (11 bytes): {"bin":700}
50-
[0] name(2,3) : value(7,3) [instances]
51-
InDom 29.2[800] labels (11 bytes): {"bin":800}
52-
[0] name(2,3) : value(7,3) [instances]
53-
InDom 29.2[900] labels (11 bytes): {"bin":900}
54-
[0] name(2,3) : value(7,3) [instances]
5537

5638
=== Dump help text
5739

qa/1502.out

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -840,38 +840,6 @@ Fri Mar 15 09:53:02.050538091 2024
840840
InDom 29.12[3] labels (0 bytes):
841841
InDom 29.12[4] labels (0 bytes):
842842
Fri Mar 15 09:53:10.084432000 2024
843-
InDom 29.3[0] labels (19 bytes): {"transient":false}
844-
[0] name(2,9) : value(13,5) [instances]
845-
InDom 29.3[21] labels (18 bytes): {"transient":true}
846-
[0] name(2,9) : value(13,4) [instances]
847-
InDom 29.3[24] labels (18 bytes): {"transient":true}
848-
[0] name(2,9) : value(13,4) [instances]
849-
InDom 29.3[26] labels (18 bytes): {"transient":true}
850-
[0] name(2,9) : value(13,4) [instances]
851-
InDom 29.3[27] labels (18 bytes): {"transient":true}
852-
[0] name(2,9) : value(13,4) [instances]
853-
InDom 29.3[29] labels (18 bytes): {"transient":true}
854-
[0] name(2,9) : value(13,4) [instances]
855-
InDom 29.3[30] labels (18 bytes): {"transient":true}
856-
[0] name(2,9) : value(13,4) [instances]
857-
InDom 29.3[35] labels (18 bytes): {"transient":true}
858-
[0] name(2,9) : value(13,4) [instances]
859-
InDom 29.3[36] labels (18 bytes): {"transient":true}
860-
[0] name(2,9) : value(13,4) [instances]
861-
InDom 29.3[37] labels (18 bytes): {"transient":true}
862-
[0] name(2,9) : value(13,4) [instances]
863-
InDom 29.3[38] labels (18 bytes): {"transient":true}
864-
[0] name(2,9) : value(13,4) [instances]
865-
InDom 29.3[39] labels (18 bytes): {"transient":true}
866-
[0] name(2,9) : value(13,4) [instances]
867-
InDom 29.3[40] labels (18 bytes): {"transient":true}
868-
[0] name(2,9) : value(13,4) [instances]
869-
InDom 29.3[41] labels (18 bytes): {"transient":true}
870-
[0] name(2,9) : value(13,4) [instances]
871-
InDom 29.3[42] labels (18 bytes): {"transient":true}
872-
[0] name(2,9) : value(13,4) [instances]
873-
InDom 29.3[43] labels (18 bytes): {"transient":true}
874-
[0] name(2,9) : value(13,4) [instances]
875843
InDom 29.10[0] labels (0 bytes):
876844
InDom 29.10[1] labels (0 bytes):
877845
InDom 29.12[1] labels (0 bytes):

src/libpcp/src/logmeta.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,16 +416,24 @@ samelabelset(const pmLabelSet *set1, const pmLabelSet *set2)
416416

417417
/*
418418
* Discard any label sets within idp which are also within idp_next.
419-
* Instance labels are a special case which cannot be reduced due to
420-
* the potentially dynamic nature of the associated instance domain.
419+
* Instance labels are a special case which cannot be reduced unless
420+
* both complete sets match exactly, due to the potentially dynamic
421+
* nature of the associated instance domain.
421422
*/
422423
static void
423424
discard_dup_labelsets(__pmLogLabelSet *idp, const __pmLogLabelSet *idp_next)
424425
{
425426
int i, j;
426427

427-
if (idp->type & PM_LABEL_INSTANCES)
428-
return;
428+
if (idp->type & PM_LABEL_INSTANCES) {
429+
if (idp->nsets != idp_next->nsets)
430+
return;
431+
for (i = 0; i < idp->nsets; ++i) {
432+
if (samelabelset(&idp->labelsets[i], &idp_next->labelsets[i]))
433+
continue;
434+
return;
435+
}
436+
}
429437

430438
for (i = 0; i < idp->nsets; ++i) {
431439
for (j = 0; j < idp_next->nsets; ++j) {

0 commit comments

Comments
 (0)