Skip to content

Commit

Permalink
update use tcp set state instead tcp finish connect
Browse files Browse the repository at this point in the history
Signed-off-by: jundizhou <jundizhou@harmonycloud.cn>
  • Loading branch information
jundizhou committed Jun 2, 2022
1 parent 5e6af46 commit 0b4c817
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
6 changes: 3 additions & 3 deletions probe/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ http_archive(

http_archive(
name = "agent-libs",
urls = ["https://github.com/Kindling-project/agent-libs/archive/eed4620f0efbb350fb98c30b85d523da89d2e764.tar.gz"],
sha256 = "d64e8ce32c1642897768f6957e81fe75d34e66c1a2baadc4160f84efedd7e412",
strip_prefix = "agent-libs-eed4620f0efbb350fb98c30b85d523da89d2e764",
urls = ["https://github.com/Kindling-project/agent-libs/archive/e7a35ca27aa076e62856024e13aae2d3859d292b.tar.gz"],
sha256 = "fa03230caf2999c5d8773130a6f9ed19ad8459a16f1b4d07390e5ec84a4b8575",
strip_prefix = "agent-libs-e7a35ca27aa076e62856024e13aae2d3859d292b",
build_file_content = BUILD_ALL_CONTENT,
)

Expand Down
22 changes: 20 additions & 2 deletions probe/src/probe/converter/sysdig_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,25 @@ int sysdig_converter::add_user_attributes(kindling::KindlingEvent *kevt, sinsp_e
}
case PPME_TCP_DROP_E:
case PPME_TCP_RETRANCESMIT_SKB_E:
case PPME_TCP_FINISH_CONNECT_E:
case PPME_TCP_SET_STATE_E: {
auto pTuple = sevt->get_param_value_raw("tuple");
setTuple(kevt, pTuple);
auto old_state = sevt->get_param_value_raw("old_state");
if (old_state != NULL) {
auto attr = kevt->add_user_attributes();
attr->set_key("old_state");
attr->set_value(old_state->m_val, old_state->m_len);
attr->set_value_type(INT32);
}
auto new_state = sevt->get_param_value_raw("new_state");
if (new_state != NULL) {
auto attr = kevt->add_user_attributes();
attr->set_key("new_state");
attr->set_value(new_state->m_val, new_state->m_len);
attr->set_value_type(INT32);
}
break;
}
case PPME_TCP_SEND_RESET_E:
case PPME_TCP_RECEIVE_RESET_E: {
auto pTuple = sevt->get_param_value_raw("tuple");
Expand Down Expand Up @@ -185,7 +203,7 @@ Source sysdig_converter::get_kindling_source(uint16_t etype) {
case PPME_TCP_CLOSE_E:
case PPME_TCP_DROP_E:
case PPME_TCP_RETRANCESMIT_SKB_E:
case PPME_TCP_FINISH_CONNECT_E:
case PPME_TCP_SET_STATE_E:
return KRPOBE;
case PPME_TCP_SEND_RESET_E:
case PPME_TCP_RECEIVE_RESET_E:
Expand Down
2 changes: 1 addition & 1 deletion probe/src/probe/publisher/defination.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const static event kindling_to_sysdig[PPM_EVENT_MAX] = {
{"kprobe-tcp_drop", PPME_TCP_DROP_E},
{"kprobe-tcp_retransmit_skb", PPME_TCP_RETRANCESMIT_SKB_E},
{"kretprobe-tcp_connect", PPME_TCP_CONNECT_X},
{"kprobe-tcp_finish_connect", PPME_TCP_FINISH_CONNECT_E},
{"kprobe-tcp_set_state", PPME_TCP_SET_STATE_E},
{"tracepoint-tcp_send_reset", PPME_TCP_SEND_RESET_E},
{"tracepoint-tcp_receive_reset", PPME_TCP_RECEIVE_RESET_E},
};
Expand Down

0 comments on commit 0b4c817

Please sign in to comment.