-
Couldn't load subscription status.
- Fork 21
Control Plane Refactor and Pipeline Mode Integration #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
121bbc1
ceee87a
0bd108d
7744f8d
3023af5
e39517a
a6985bd
3f3288a
c991044
ad1b18d
49a7e81
018fc1a
397e7e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,17 @@ static struct api_out stats_get(const void *request, void **response) { | |
| continue; | ||
| for (unsigned i = 0; i < w_stats->n_stats; i++) { | ||
| const struct node_stats *n = &w_stats->stats[i]; | ||
| const char *name = rte_node_id_to_name(n->node_id); | ||
| const struct rte_node_register *nr = gr_node_info_get(n->node_id) | ||
| ->node; | ||
| char name[RTE_NODE_NAMESIZE]; | ||
| snprintf( | ||
|
Comment on lines
+53
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Return value of |
||
| name, | ||
| RTE_NODE_NAMESIZE, | ||
| "%s%c", | ||
| rte_node_id_to_name(n->node_id), | ||
| nr->flags & GR_NODE_FLAG_CONTROL_PLANE ? '*' : '\0' | ||
| ); | ||
|
|
||
| s = find_stat(stats, name); | ||
| if (s != NULL) { | ||
| s->objs += n->objs; | ||
|
|
@@ -66,6 +76,39 @@ static struct api_out stats_get(const void *request, void **response) { | |
| gr_vec_add(stats, stat); | ||
| } | ||
| } | ||
|
|
||
| if (worker->stats_ctl) | ||
| for (unsigned i = 0; i < worker->stats_ctl->n_stats; i++) { | ||
| const struct node_stats *n = &w_stats->stats[i]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Wrong stats array accessed. Line 82 is accessing the wrong stats array - it should use Apply this diff to fix the array access: - const struct node_stats *n = &w_stats->stats[i];
+ const struct node_stats *n = &worker->stats_ctl->stats[i];🤖 Prompt for AI Agents |
||
| const struct rte_node_register *nr = gr_node_info_get( | ||
| n->node_id | ||
| ) | ||
| ->node; | ||
| char name[RTE_NODE_NAMESIZE]; | ||
| snprintf( | ||
| name, | ||
| RTE_NODE_NAMESIZE, | ||
| "%s%c", | ||
| rte_node_id_to_name(n->node_id), | ||
| nr->flags & GR_NODE_FLAG_CONTROL_PLANE ? '*' : '\0' | ||
| ); | ||
|
|
||
| s = find_stat(stats, name); | ||
| if (s != NULL) { | ||
| s->objs += n->objs; | ||
| s->calls += n->calls; | ||
| s->cycles += n->cycles; | ||
| } else { | ||
| struct stat stat = { | ||
| .objs = n->objs, | ||
| .calls = n->calls, | ||
| .cycles = n->cycles, | ||
| }; | ||
| memccpy(stat.name, name, 0, sizeof(stat.name)); | ||
christophefontaine marked this conversation as resolved.
Show resolved
Hide resolved
christophefontaine marked this conversation as resolved.
Show resolved
Hide resolved
christophefontaine marked this conversation as resolved.
Show resolved
Hide resolved
christophefontaine marked this conversation as resolved.
Show resolved
Hide resolved
christophefontaine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| gr_vec_add(stats, stat); | ||
| } | ||
| } | ||
|
|
||
| s = find_stat(stats, "idle"); | ||
| if (s != NULL) { | ||
| s->calls += w_stats->n_sleeps; | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snprintf return value is not checked; truncated node names could be silently dropped—consider handling truncation.