函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_events_hist.c Create Date:2022-07-27 13:40:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:reate_field_var_hist - Automatically create a histogram and var for a field*@target_hist_data: The target hist trigger*@subsys_name: Optional subsystem name*@event_name: Optional event name*@field_name: The name of the field (and the resulting variable)*

函数原型:static struct hist_field *create_field_var_hist(struct hist_trigger_data *target_hist_data, char *subsys_name, char *event_name, char *field_name)

返回类型:struct hist_field

参数:

类型参数名称
struct hist_trigger_data *target_hist_data
char *subsys_name
char *event_name
char *field_name
3289  tr等于tr
3290  event_var等于错误号
3292  unsigned int i, n, first = true
3300  如果n_field_var_hists大于等于SYNTH_FIELDS_MAX
3301  hist_err(tr, HIST_ERR_TOO_MANY_FIELD_VARS, errpos(field_name))
3302  返回:错误号
3305  file等于event_file(tr, subsys_name, event_name)
3307  如果是错误
3308  hist_err(tr, HIST_ERR_EVENT_FILE_NOT_FOUND, errpos(field_name))
3309  ret等于错误
3310  返回:错误号
3319  hist_data等于find_compatible_hist(target_hist_data, file)
3320  如果非hist_data
3321  hist_err(tr, HIST_ERR_HIST_NOT_FOUND, errpos(field_name))
3322  返回:错误号
3326  event_var等于find_synthetic_field_var(target_hist_data, subsys_name, event_name, field_name)
3328  如果非是错误或空则返回:event_var
3331  var_hist等于分配内存并置零
3332  如果非var_hist则返回:错误号
3335  cmd等于分配内存并置零
3336  如果非cmd
3337  kfree(var_hist)
3338  返回:错误号
3342  strcat(cmd, "keys=")
3345  key_field等于fields[i]
3346  如果非firststrcat(cmd, ",")
3348  strcat(cmd, name)
3349  first = false
3353  strcat(cmd, ":synthetic_")
3354  strcat(cmd, field_name)
3355  strcat(cmd, "=")
3356  strcat(cmd, field_name)
3359  saved_filter等于find_trigger_filter(hist_data, file)
3360  如果saved_filter
3361  strcat(cmd, " if ")
3362  strcat(cmd, saved_filter)
3365  cmd等于kstrdup(cmd, GFP_KERNEL)
3366  如果非cmd
3367  kfree(cmd)
3368  kfree(var_hist)
3369  返回:错误号
3373  hist_data等于hist_data
3376  ret等于event_hist_trigger_func( & trigger_hist_cmd, file, "", "hist", cmd)
3378  如果ret
3379  kfree(cmd)
3380  kfree(cmd)
3381  kfree(var_hist)
3382  hist_err(tr, HIST_ERR_HIST_CREATE_FAIL, errpos(field_name))
3383  返回:错误号
3386  kfree(cmd)
3389  event_var等于find_synthetic_field_var(target_hist_data, subsys_name, event_name, field_name)
3391  如果是错误或空
3392  kfree(cmd)
3393  kfree(var_hist)
3394  hist_err(tr, HIST_ERR_SYNTH_VAR_NOT_FOUND, errpos(field_name))
3395  返回:错误号
3398  n等于n_field_var_hists
3399  field_var_hists[n]等于var_hist
3400  n_field_var_hists自加
3402  返回:event_var
调用者
名称描述
trace_action_create_field_var