TSG-23378 TFE移除平台层的FieldStat2,为适配AArch64做准备

This commit is contained in:
luwenpeng
2024-11-13 14:09:03 +08:00
parent aa98cf915e
commit 3d99178958
18 changed files with 223 additions and 336 deletions

View File

@@ -152,7 +152,7 @@ struct tsg_proxy_rt
int plolicy_table_id[POLICY_PROFILE_TABLE_MAX];
ctemplate::Template * tpl_403, * tpl_404, * tpl_451;
screen_stat_handle_t fs_handle;
struct fieldstat_easy *fs_handle;
long long stat_val[__PX_STAT_MAX];
int fs_id[__PX_STAT_MAX];
struct event_base* gc_evbase;
@@ -167,15 +167,13 @@ struct tsg_proxy_rt
};
struct tsg_proxy_rt * g_proxy_rt;
static void proxy_http_gc_cb(evutil_socket_t fd, short what, void * arg)
static void proxy_http_gc_cb(evutil_socket_t fd, short what, void *arg)
{
int i=0;
for(i=0;i<__PX_STAT_MAX;i++)
for (int i = 0; i < __PX_STAT_MAX; i++)
{
FS_operate(g_proxy_rt->fs_handle, g_proxy_rt->fs_id[i], 0, FS_OP_SET, ATOMIC_READ(&(g_proxy_rt->stat_val[i])));
long long delta = ATOMIC_EXCHANGE(&(g_proxy_rt->stat_val[i]), 0);
fieldstat_easy_counter_incrby(g_proxy_rt->fs_handle, 0, g_proxy_rt->fs_id[i], NULL, 0, delta);
}
return;
}
static void proxy_http_stat_init(struct tsg_proxy_rt * pangu_runtime)
@@ -200,9 +198,9 @@ static void proxy_http_stat_init(struct tsg_proxy_rt * pangu_runtime)
for(i=0;i<__PX_STAT_MAX;i++)
{
if(spec[i]!=NULL)
if (spec[i] != NULL)
{
pangu_runtime->fs_id[i]=FS_register(pangu_runtime->fs_handle, FS_STYLE_FIELD, FS_CALC_CURRENT, spec[i]);
pangu_runtime->fs_id[i] = fieldstat_easy_register_counter(pangu_runtime->fs_handle, spec[i]);
}
}
g_proxy_rt->gcev = event_new(pangu_runtime->gc_evbase, -1, EV_PERSIST, proxy_http_gc_cb, NULL);