Skip to content

Commit

Permalink
Fix more %lld and %llx diag printf
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed Nov 10, 2024
1 parent b845a53 commit c1db0ce
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/collector/collector.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ void FlushExporterStats(FlowSource_t *fs) {
exporter_stats->stat[i].packets = e->packets;
exporter_stats->stat[i].flows = e->flows;
#ifdef DEVEL
printf("Stat: SysID: %u, version: %u, ID: %2u, Packets: %llu, Flows: %llu, Sequence Failures: %u\n", e->info.sysid, e->info.version,
e->info.id, e->packets, e->flows, e->sequence_failure);
printf("Stat: SysID: %u, version: %u, ID: %2u, Packets: %" PRIu64 ", Flows: %" PRIu64 ", Sequence Failures: %u\n", e->info.sysid,
e->info.version, e->info.id, e->packets, e->flows, e->sequence_failure);

#endif
// reset counters
Expand Down
22 changes: 11 additions & 11 deletions src/netflow/ipfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ static void InsertSampler(FlowSource_t *fs, exporterDomain_t *exporter, sampler_
exporter->sampler = sampler;

fs->dataBlock = AppendToBuffer(fs->nffile, fs->dataBlock, &(sampler->record), sampler->record.size);
LogInfo("Add new sampler id: %lli, algorithm: %u, packet interval: %u, packet space: %u", sampler_record->id, sampler_record->algorithm,
sampler_record->packetInterval, sampler_record->spaceInterval);
dbg_printf("Add new sampler id: %lli, algorithm: %u, packet interval: %u, packet space: %u\n", sampler_record->id, sampler_record->algorithm,
sampler_record->packetInterval, sampler_record->spaceInterval);
LogInfo("Add new sampler id: %" PRId64 ", algorithm: %u, packet interval: %u, packet space: %u", sampler_record->id,
sampler_record->algorithm, sampler_record->packetInterval, sampler_record->spaceInterval);
dbg_printf("Add new sampler id: %" PRId64 ", algorithm: %u, packet interval: %u, packet space: %u\n", sampler_record->id,
sampler_record->algorithm, sampler_record->packetInterval, sampler_record->spaceInterval);

} else {
sampler = exporter->sampler;
Expand All @@ -543,9 +543,9 @@ static void InsertSampler(FlowSource_t *fs, exporterDomain_t *exporter, sampler_
sampler->record.algorithm = sampler_record->algorithm;
sampler->record.packetInterval = sampler_record->packetInterval;
sampler->record.spaceInterval = sampler_record->spaceInterval;
LogInfo("Update existing sampler id: %lli, algorithm: %u, packet interval: %u, packet space: %u", sampler_record->id,
LogInfo("Update existing sampler id: %" PRId64 ", algorithm: %u, packet interval: %u, packet space: %u", sampler_record->id,
sampler_record->algorithm, sampler_record->packetInterval, sampler_record->spaceInterval);
dbg_printf("Update existing sampler id: %lli, algorithm: %u, packet interval: %u, packet space: %u\n", sampler_record->id,
dbg_printf("Update existing sampler id: %" PRId64 " , algorithm: %u, packet interval: %u, packet space: %u\n", sampler_record->id,
sampler_record->algorithm, sampler_record->packetInterval, sampler_record->spaceInterval);
} else {
dbg_printf("Sampler unchanged!\n");
Expand All @@ -570,9 +570,9 @@ static void InsertSampler(FlowSource_t *fs, exporterDomain_t *exporter, sampler_
sampler->next = NULL;

fs->dataBlock = AppendToBuffer(fs->nffile, fs->dataBlock, &(sampler->record), sampler->record.size);
LogInfo("Append new sampler id: %lli, algorithm: %u, packet interval: %u, packet space: %u", sampler_record->id,
LogInfo("Append new sampler id: %" PRId64 ", algorithm: %u, packet interval: %u, packet space: %u", sampler_record->id,
sampler_record->algorithm, sampler_record->packetInterval, sampler_record->spaceInterval);
dbg_printf("Append new sampler id: %lli, algorithm: %u, packet interval: %u, packet space: %u\n", sampler_record->id,
dbg_printf("Append new sampler id: %" PRId64 ", algorithm: %u, packet interval: %u, packet space: %u\n", sampler_record->id,
sampler_record->algorithm, sampler_record->packetInterval, sampler_record->spaceInterval);
break;
}
Expand Down Expand Up @@ -1169,7 +1169,7 @@ static void Process_ipfix_option_templates(exporterDomain_t *exporter, void *opt
}
optionTemplate->optionSize = offset;

dbg_printf("\n[%u] Option size: %" PRIu64 ", flags: %llx\n", exporter->info.id, optionTemplate->optionSize, optionTemplate->flags);
dbg_printf("\n[%u] Option size: %" PRIu64 ", flags: %" PRIx64 "\n", exporter->info.id, optionTemplate->optionSize, optionTemplate->flags);
if (optionTemplate->flags) {
// if it exitsts - remove old template on exporter with same ID
templateList_t *template = newTemplate(exporter, tableID);
Expand Down Expand Up @@ -1594,7 +1594,7 @@ static inline void Process_ipfix_sampler_option_data(exporterDomain_t *exporter,
dbg_printf("New std sampler: algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.algorithm,
sampler_record.packetInterval, sampler_record.spaceInterval);
} else {
dbg_printf("ID : %lld, algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
dbg_printf("ID : %" PRId64 ", algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
sampler_record.packetInterval, sampler_record.spaceInterval);
}

Expand All @@ -1619,7 +1619,7 @@ static inline void Process_ipfix_sampler_option_data(exporterDomain_t *exporter,
LogError("Process_ipfix_option: Zero sampling interval -> sampling == 1", __FILE__, __LINE__);
}
}
dbg_printf("ID : %lld, algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
dbg_printf("ID : %" PRId64 ", algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
sampler_record.packetInterval, sampler_record.spaceInterval);

InsertSampler(fs, exporter, &sampler_record);
Expand Down
6 changes: 3 additions & 3 deletions src/netflow/netflow_v9.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ static inline void Process_v9_option_templates(exporterDomain_t *exporter, void
}
optionTemplate->optionSize = offset;

dbg_printf("\n[%u] Option size: %" PRIu64 ", flags: %llx\n", exporter->info.id, optionTemplate->optionSize, optionTemplate->flags);
dbg_printf("\n[%u] Option size: %" PRIu64 ", flags: %" PRIx64 "\n", exporter->info.id, optionTemplate->optionSize, optionTemplate->flags);
if (optionTemplate->flags) {
// if it exitsts - remove old template on exporter with same ID
templateList_t *template = newTemplate(exporter, tableID);
Expand Down Expand Up @@ -1358,7 +1358,7 @@ static inline void Process_v9_sampler_option_data(exporterDomain_t *exporter, Fl
dbg_printf("New std sampler: algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.algorithm,
sampler_record.packetInterval, sampler_record.spaceInterval);
} else {
dbg_printf("ID : %lld, algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
dbg_printf("ID : %" PRId64 ", algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
sampler_record.packetInterval, sampler_record.spaceInterval);
}

Expand All @@ -1383,7 +1383,7 @@ static inline void Process_v9_sampler_option_data(exporterDomain_t *exporter, Fl
LogError("Process_v9_option: Zero sampling interval -> sampling == 1", __FILE__, __LINE__);
}
}
dbg_printf("ID : %lld, algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
dbg_printf("ID : %" PRId64 ", algorithm : %u, packet interval: %u, packet space: %u\n", sampler_record.id, sampler_record.algorithm,
sampler_record.packetInterval, sampler_record.spaceInterval);

InsertSampler(fs, exporter, &sampler_record);
Expand Down
2 changes: 1 addition & 1 deletion src/nfdump/nflowcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ char *ParseAggregateMask(char *print_format, char *arg) {
if (aggregationTable[index].netmaskID && aggregationTable[index].netmaskID != 0xFF) {
uint32_t maskIndex = aggregationTable[index].netmaskID;
printf("v4mask : 0x%x\n", maskArray[maskIndex].v4Mask);
printf("v6mask : 0x%llx 0x%llx\n", maskArray[maskIndex].v6Mask[0], maskArray[maskIndex].v6Mask[1]);
printf("v6mask : 0x%" PRIx64 " 0x%" PRIx64 "\n", maskArray[maskIndex].v6Mask[0], maskArray[maskIndex].v6Mask[1]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/sflow/sflow_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ static void readCounters_radio(SFSample *sample) {

static void readCounters_OFPort(SFSample *sample) {
uint64_t dpid = getData64(sample);
dbg_printf("openflow_datapath_id %llx\n", dpid);
dbg_printf("openflow_datapath_id %" PRIx64 "\n", dpid);
sf_log_next32(sample, "openflow_port");
}

Expand Down

0 comments on commit c1db0ce

Please sign in to comment.