Re: [PATCH 3/7] tracing: Pass buffer of event to trigger operations

From: kernel test robot
Date: Fri Mar 12 2021 - 23:06:36 EST


Hi Steven,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.12-rc2 next-20210312]
[cannot apply to tip/perf/core hnaz-linux-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Steven-Rostedt/tracing-Have-ring_buffer_event_time_stamp-work-for-all-events/20210313-051807
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a74e6a014c9d4d4161061f770c9b4f98372ac778
config: x86_64-randconfig-a004-20210312 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project dfd27ebbd0eb137c9a439b7c537bb87ba903efd3)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/e0953acfef6e9234feed2877ed1b0a796755ceb6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Steven-Rostedt/tracing-Have-ring_buffer_event_time_stamp-work-for-all-events/20210313-051807
git checkout e0953acfef6e9234feed2877ed1b0a796755ceb6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> kernel/trace/trace_events_hist.c:3191:30: error: incompatible function pointer types assigning to 'action_fn_t' (aka 'void (*)(struct hist_trigger_data *, struct tracing_map_elt *, struct trace_buffer *, void *, struct ring_buffer_event *, void *, struct action_data *, unsigned long long *)') from 'void (struct hist_trigger_data *, struct tracing_map_elt *, void *, struct ring_buffer_event *, void *, struct action_data *, u64 *)' (aka 'void (struct hist_trigger_data *, struct tracing_map_elt *, void *, struct ring_buffer_event *, void *, struct action_data *, unsigned long long *)') [-Werror,-Wincompatible-function-pointer-types]
data->track_data.save_data = save_track_data_snapshot;
^ ~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


vim +3191 kernel/trace/trace_events_hist.c

50450603ec9cb8 Tom Zanussi 2018-01-15 3125
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3126) static int action_parse(struct trace_array *tr, char *str, struct action_data *data,
7d18a10c316783 Tom Zanussi 2019-02-13 3127 enum handler_id handler)
7d18a10c316783 Tom Zanussi 2019-02-13 3128 {
7d18a10c316783 Tom Zanussi 2019-02-13 3129 char *action_name;
7d18a10c316783 Tom Zanussi 2019-02-13 3130 int ret = 0;
7d18a10c316783 Tom Zanussi 2019-02-13 3131
7d18a10c316783 Tom Zanussi 2019-02-13 3132 strsep(&str, ".");
7d18a10c316783 Tom Zanussi 2019-02-13 3133 if (!str) {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3134) hist_err(tr, HIST_ERR_ACTION_NOT_FOUND, 0);
7d18a10c316783 Tom Zanussi 2019-02-13 3135 ret = -EINVAL;
7d18a10c316783 Tom Zanussi 2019-02-13 3136 goto out;
7d18a10c316783 Tom Zanussi 2019-02-13 3137 }
7d18a10c316783 Tom Zanussi 2019-02-13 3138
7d18a10c316783 Tom Zanussi 2019-02-13 3139 action_name = strsep(&str, "(");
7d18a10c316783 Tom Zanussi 2019-02-13 3140 if (!action_name || !str) {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3141) hist_err(tr, HIST_ERR_ACTION_NOT_FOUND, 0);
7d18a10c316783 Tom Zanussi 2019-02-13 3142 ret = -EINVAL;
7d18a10c316783 Tom Zanussi 2019-02-13 3143 goto out;
7d18a10c316783 Tom Zanussi 2019-02-13 3144 }
7d18a10c316783 Tom Zanussi 2019-02-13 3145
7d18a10c316783 Tom Zanussi 2019-02-13 3146 if (str_has_prefix(action_name, "save")) {
7d18a10c316783 Tom Zanussi 2019-02-13 3147 char *params = strsep(&str, ")");
7d18a10c316783 Tom Zanussi 2019-02-13 3148
7d18a10c316783 Tom Zanussi 2019-02-13 3149 if (!params) {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3150) hist_err(tr, HIST_ERR_NO_SAVE_PARAMS, 0);
7d18a10c316783 Tom Zanussi 2019-02-13 3151 ret = -EINVAL;
7d18a10c316783 Tom Zanussi 2019-02-13 3152 goto out;
7d18a10c316783 Tom Zanussi 2019-02-13 3153 }
7d18a10c316783 Tom Zanussi 2019-02-13 3154
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3155) ret = parse_action_params(tr, params, data);
7d18a10c316783 Tom Zanussi 2019-02-13 3156 if (ret)
7d18a10c316783 Tom Zanussi 2019-02-13 3157 goto out;
7d18a10c316783 Tom Zanussi 2019-02-13 3158
7d18a10c316783 Tom Zanussi 2019-02-13 3159 if (handler == HANDLER_ONMAX)
466f4528fbc692 Tom Zanussi 2019-02-13 3160 data->track_data.check_val = check_track_val_max;
dff81f559285b5 Tom Zanussi 2019-02-13 3161 else if (handler == HANDLER_ONCHANGE)
dff81f559285b5 Tom Zanussi 2019-02-13 3162 data->track_data.check_val = check_track_val_changed;
466f4528fbc692 Tom Zanussi 2019-02-13 3163 else {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3164) hist_err(tr, HIST_ERR_ACTION_MISMATCH, errpos(action_name));
466f4528fbc692 Tom Zanussi 2019-02-13 3165 ret = -EINVAL;
466f4528fbc692 Tom Zanussi 2019-02-13 3166 goto out;
466f4528fbc692 Tom Zanussi 2019-02-13 3167 }
7d18a10c316783 Tom Zanussi 2019-02-13 3168
466f4528fbc692 Tom Zanussi 2019-02-13 3169 data->track_data.save_data = save_track_data_vars;
466f4528fbc692 Tom Zanussi 2019-02-13 3170 data->fn = ontrack_action;
7d18a10c316783 Tom Zanussi 2019-02-13 3171 data->action = ACTION_SAVE;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3172 } else if (str_has_prefix(action_name, "snapshot")) {
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3173 char *params = strsep(&str, ")");
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3174
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3175 if (!str) {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3176) hist_err(tr, HIST_ERR_NO_CLOSING_PAREN, errpos(params));
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3177 ret = -EINVAL;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3178 goto out;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3179 }
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3180
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3181 if (handler == HANDLER_ONMAX)
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3182 data->track_data.check_val = check_track_val_max;
dff81f559285b5 Tom Zanussi 2019-02-13 3183 else if (handler == HANDLER_ONCHANGE)
dff81f559285b5 Tom Zanussi 2019-02-13 3184 data->track_data.check_val = check_track_val_changed;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3185 else {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3186) hist_err(tr, HIST_ERR_ACTION_MISMATCH, errpos(action_name));
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3187 ret = -EINVAL;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3188 goto out;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3189 }
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3190
a3785b7eca8fd4 Tom Zanussi 2019-02-13 @3191 data->track_data.save_data = save_track_data_snapshot;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3192 data->fn = ontrack_action;
a3785b7eca8fd4 Tom Zanussi 2019-02-13 3193 data->action = ACTION_SNAPSHOT;
7d18a10c316783 Tom Zanussi 2019-02-13 3194 } else {
7d18a10c316783 Tom Zanussi 2019-02-13 3195 char *params = strsep(&str, ")");
7d18a10c316783 Tom Zanussi 2019-02-13 3196
e91eefd731d933 Tom Zanussi 2019-02-13 3197 if (str_has_prefix(action_name, "trace"))
e91eefd731d933 Tom Zanussi 2019-02-13 3198 data->use_trace_keyword = true;
e91eefd731d933 Tom Zanussi 2019-02-13 3199
7d18a10c316783 Tom Zanussi 2019-02-13 3200 if (params) {
d0cd871ba0d613 Steven Rostedt (VMware 2019-04-01 3201) ret = parse_action_params(tr, params, data);
7d18a10c316783 Tom Zanussi 2019-02-13 3202 if (ret)
7d18a10c316783 Tom Zanussi 2019-02-13 3203 goto out;
7d18a10c316783 Tom Zanussi 2019-02-13 3204 }
7d18a10c316783 Tom Zanussi 2019-02-13 3205
466f4528fbc692 Tom Zanussi 2019-02-13 3206 if (handler == HANDLER_ONMAX)
466f4528fbc692 Tom Zanussi 2019-02-13 3207 data->track_data.check_val = check_track_val_max;
dff81f559285b5 Tom Zanussi 2019-02-13 3208 else if (handler == HANDLER_ONCHANGE)
dff81f559285b5 Tom Zanussi 2019-02-13 3209 data->track_data.check_val = check_track_val_changed;
466f4528fbc692 Tom Zanussi 2019-02-13 3210
466f4528fbc692 Tom Zanussi 2019-02-13 3211 if (handler != HANDLER_ONMATCH) {
466f4528fbc692 Tom Zanussi 2019-02-13 3212 data->track_data.save_data = action_trace;
466f4528fbc692 Tom Zanussi 2019-02-13 3213 data->fn = ontrack_action;
466f4528fbc692 Tom Zanussi 2019-02-13 3214 } else
7d18a10c316783 Tom Zanussi 2019-02-13 3215 data->fn = action_trace;
466f4528fbc692 Tom Zanussi 2019-02-13 3216
7d18a10c316783 Tom Zanussi 2019-02-13 3217 data->action = ACTION_TRACE;
7d18a10c316783 Tom Zanussi 2019-02-13 3218 }
7d18a10c316783 Tom Zanussi 2019-02-13 3219
7d18a10c316783 Tom Zanussi 2019-02-13 3220 data->action_name = kstrdup(action_name, GFP_KERNEL);
7d18a10c316783 Tom Zanussi 2019-02-13 3221 if (!data->action_name) {
7d18a10c316783 Tom Zanussi 2019-02-13 3222 ret = -ENOMEM;
7d18a10c316783 Tom Zanussi 2019-02-13 3223 goto out;
7d18a10c316783 Tom Zanussi 2019-02-13 3224 }
7d18a10c316783 Tom Zanussi 2019-02-13 3225
7d18a10c316783 Tom Zanussi 2019-02-13 3226 data->handler = handler;
7d18a10c316783 Tom Zanussi 2019-02-13 3227 out:
7d18a10c316783 Tom Zanussi 2019-02-13 3228 return ret;
7d18a10c316783 Tom Zanussi 2019-02-13 3229 }
7d18a10c316783 Tom Zanussi 2019-02-13 3230

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip