Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_events_hist.c Create Date:2022-07-28 12:32:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:create_sort_keys

Proto:static int create_sort_keys(struct hist_trigger_data *hist_data)

Type:int

Parameter:

TypeParameterName
struct hist_trigger_data *hist_data
4799  fields_str = sort_key_str
4801  ret = 0
4804  n_sort_keys = 1
4806  If Not fields_str Then Go to out
4809  When i < TRACING_MAP_SORT_KEYS_MAX cycle
4814  sort_key = sort_keys[i]
4816  field_str = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
4817  If Not field_str Then Break
4820  If Not field_str Then
4821  ret = -EINVAL
4822  Break
4825  If i == TRACING_MAP_SORT_KEYS_MAX - 1 && fields_str Then
4826  ret = -EINVAL
4827  Break
4830  field_name = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
4831  If Not field_name || Not field_name Then
4832  ret = -EINVAL
4833  Break
4836  If strcmp(field_name, "hitcount") == 0 Then
4838  If descending < 0 Then
4839  ret = descending
4840  Break
4843  Continue
4846  When j < n_fields cycle
4849  hist_field = fields[j]
4850  If flags & HIST_FIELD_FL_VAR Then Continue
4853  idx = k++
4857  If strcmp(field_name, test_name) == 0 Then
4858  field_idx = idx
4860  If descending < 0 Then
4861  ret = descending
4862  Go to out
4865  Break
4868  If j == n_fields Then
4869  ret = -EINVAL
4870  Break
4874  n_sort_keys = i
4875  out :
4876  Return ret
Caller
NameDescribe
create_hist_data