Skip to content

Commit

Permalink
fix: PDHists adding missing template fields
Browse files Browse the repository at this point in the history
  • Loading branch information
optdcw committed Nov 13, 2023
1 parent 2aa92cd commit 0d5cbd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions process/pdhists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void PDHISTSPlugin::update_record(RecordExtPDHISTS *pdhists_data, const Packet &
return;
}
uint64_t inv_dst = std::numeric_limits<uint64_t>::max();
uint64_t inv_ipt = std::numeric_limits<uint64_t>::max();
uint8_t direction = pkt.source_pkt ? 0 : 1;
uint64_t pkt_dir_chan_dst = calculate_packet_dst(pkt.channel_index, pdhists_data->last_pkt_index_channel[direction]);
uint64_t pkt_dir_link_dst = calculate_packet_dst(pkt.link_index, pdhists_data->last_pkt_index_intf[direction]);
Expand All @@ -163,7 +164,7 @@ void PDHISTSPlugin::update_record(RecordExtPDHISTS *pdhists_data, const Packet &
if (pkt_dir_store_dst != inv_dst) {
update_hist((uint32_t) pkt_dir_store_dst, pdhists_data->dist_hist_store[direction], HISTOGRAM_OFFSET, HISTOGRAM_SIZE);
}
if (pkt_dir_ipt != inv_dst) {
if (pkt_dir_ipt != inv_ipt) {
update_hist((uint32_t) pkt_dir_ipt, pdhists_data->ipt_hist[direction], HISTOGRAM_IPT_OFFSET, HISTOGRAM_IPT_SIZE);
}
if (pkt_chan_dst != inv_dst) {
Expand All @@ -175,7 +176,7 @@ void PDHISTSPlugin::update_record(RecordExtPDHISTS *pdhists_data, const Packet &
if (pkt_store_dst != inv_dst) {
update_hist((uint32_t) pkt_store_dst, pdhists_data->dist_hist_store[2], HISTOGRAM_OFFSET, HISTOGRAM_SIZE);
}
if (pkt_ipt != inv_dst) {
if (pkt_ipt != inv_ipt) {
update_hist((uint32_t) pkt_ipt, pdhists_data->ipt_hist[2], HISTOGRAM_IPT_OFFSET, HISTOGRAM_IPT_SIZE);
}

Expand Down
3 changes: 1 addition & 2 deletions process/pdhists.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace ipxp {
#define HISTOGRAM_IPT_OFFSET 0
#define HISTOGRAM_IPT_SIZE 20

#define PDHISTS_UNIREC_TEMPLATE "S_PDHISTS_CHAN,D_PDHISTS_CHAN,B_PDHISTS_CHAN,S_PDHISTS_INTF,D_PDHISTS_INTF,B_PDHISTS_INTF,S_PTHISTS,D_PTHISTS,B_PTHISTS"
#define PDHISTS_UNIREC_TEMPLATE "S_PDHISTS_CHAN,D_PDHISTS_CHAN,B_PDHISTS_CHAN,S_PDHISTS_INTF,D_PDHISTS_INTF,B_PDHISTS_INTF,S_PDHISTS_STORE,D_PDHISTS_STORE,B_PDHISTS_STORE,S_PTHISTS,D_PTHISTS,B_PTHISTS"
UR_FIELDS(
uint32* S_PDHISTS_CHAN,
uint32* D_PDHISTS_CHAN,
Expand Down Expand Up @@ -176,7 +176,6 @@ struct RecordExtPDHISTS : public RecordExt {
ur_array_allocate(tmplt, record, F_S_PDHISTS_STORE, HISTOGRAM_SIZE);
ur_array_allocate(tmplt, record, F_D_PDHISTS_STORE, HISTOGRAM_SIZE);
ur_array_allocate(tmplt, record, F_B_PDHISTS_STORE, HISTOGRAM_SIZE);

ur_array_allocate(tmplt, record, F_S_PTHISTS, HISTOGRAM_IPT_SIZE);
ur_array_allocate(tmplt, record, F_B_PTHISTS, HISTOGRAM_IPT_SIZE);
ur_array_allocate(tmplt, record, F_D_PTHISTS, HISTOGRAM_IPT_SIZE);
Expand Down

0 comments on commit 0d5cbd0

Please sign in to comment.