Skip to content

Commit

Permalink
Remove exporter stuff from profiler. Not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed Mar 31, 2024
1 parent d4420f7 commit 819d8bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
3 changes: 1 addition & 2 deletions src/nfsen/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ bin_PROGRAMS += nftrack
endif

nfstatfile = ../collector/nfstatfile.c ../collector/nfstatfile.h
exporter = ../nfdump/exporter.c

nfprofile_SOURCES = nfprofile.c profile.c profile.h $(nfstatfile) $(exporter)
nfprofile_SOURCES = nfprofile.c profile.c profile.h $(nfstatfile)
nfprofile_LDADD = -lnfdump -lnffile -lrrd
nfprofile_LDFLAGS = -L../libnfdump -L../libnffile

Expand Down
37 changes: 9 additions & 28 deletions src/nfsen/nfprofile.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include <unistd.h>

#include "conf/nfconf.h"
#include "exporter.h"
#include "filter/filter.h"
#include "flist.h"
#include "nbar.h"
Expand Down Expand Up @@ -185,34 +184,20 @@ static void process_data(profile_channel_info_t *channels, unsigned int num_chan

break;
case ExporterInfoRecordType: {
int err = AddExporterInfo((exporter_info_record_t *)record_ptr);
if (err != 0) {
for (int j = 0; j < num_channels; j++) {
if (channels[j].nffile != NULL && err == 1) {
// flush new exporter
channels[j].dataBlock =
AppendToBuffer(channels[j].nffile, channels[j].dataBlock, (void *)record_ptr, record_ptr->size);
}
for (int j = 0; j < num_channels; j++) {
if (channels[j].nffile != NULL) {
// flush new exporter
channels[j].dataBlock = AppendToBuffer(channels[j].nffile, channels[j].dataBlock, (void *)record_ptr, record_ptr->size);
}
} else {
LogError("Failed to add Exporter Record");
}
} break;
case SamplerLegacyRecordType: {
if (AddSamplerLegacyRecord((samplerV0_record_t *)record_ptr) == 0) LogError("Failed to add legacy Sampler Record\n");
} break;
case SamplerLegacyRecordType:
case SamplerRecordType: {
int err = AddSamplerRecord((sampler_record_t *)record_ptr);
if (err != 0) {
for (int j = 0; j < num_channels; j++) {
if (channels[j].nffile != NULL && err == 1) {
// flush new map
channels[j].dataBlock =
AppendToBuffer(channels[j].nffile, channels[j].dataBlock, (void *)record_ptr, record_ptr->size);
}
for (int j = 0; j < num_channels; j++) {
if (channels[j].nffile != NULL) {
// flush new map
channels[j].dataBlock = AppendToBuffer(channels[j].nffile, channels[j].dataBlock, (void *)record_ptr, record_ptr->size);
}
} else {
LogError("Failed to add Sampler Record");
}
} break;
case NbarRecordType:
Expand Down Expand Up @@ -618,10 +603,6 @@ int main(int argc, char **argv) {
exit(255);
}

if (!InitExporterList()) {
exit(255);
}

queue_t *fileList = SetupInputFileSequence(&flist);
if (!fileList || !Init_nffile(DEFAULTWORKERS, fileList)) exit(254);

Expand Down

0 comments on commit 819d8bc

Please sign in to comment.