Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

stm class: Propagate source type to protocols

Pass stm source type via stm_write() to allow different handling on
protocol level.

The measure above should allow protocol level encoder to differentiate
and accordingly pack the messages. As an example SyS-T might get use of
ftrace message ID's and instead of applying regular header, pack them
as SyS-T catalog or SyS-T Structured Binary Data message to allow proper
decoding on the other side.

Signed-off-by: Mikhail Lappo <miklelappo@gmail.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-4-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mikhail Lappo and committed by
Greg Kroah-Hartman
ee27f44e 07cf8356

+9 -7
+4 -4
drivers/hwtracing/stm/core.c
··· 600 600 601 601 static ssize_t notrace 602 602 stm_write(struct stm_device *stm, struct stm_output *output, 603 - unsigned int chan, const char *buf, size_t count) 603 + unsigned int chan, const char *buf, size_t count, struct stm_source_data *source) 604 604 { 605 605 int err; 606 606 ··· 608 608 if (!stm->pdrv) 609 609 return -ENODEV; 610 610 611 - err = stm->pdrv->write(stm->data, output, chan, buf, count); 611 + err = stm->pdrv->write(stm->data, output, chan, buf, count, source); 612 612 if (err < 0) 613 613 return err; 614 614 ··· 657 657 658 658 pm_runtime_get_sync(&stm->dev); 659 659 660 - count = stm_write(stm, &stmf->output, 0, kbuf, count); 660 + count = stm_write(stm, &stmf->output, 0, kbuf, count, NULL); 661 661 662 662 pm_runtime_mark_last_busy(&stm->dev); 663 663 pm_runtime_put_autosuspend(&stm->dev); ··· 1299 1299 1300 1300 stm = srcu_dereference(src->link, &stm_source_srcu); 1301 1301 if (stm) 1302 - count = stm_write(stm, &src->output, chan, buf, count); 1302 + count = stm_write(stm, &src->output, chan, buf, count, data); 1303 1303 else 1304 1304 count = -ENODEV; 1305 1305
+2 -1
drivers/hwtracing/stm/p_basic.c
··· 10 10 #include "stm.h" 11 11 12 12 static ssize_t basic_write(struct stm_data *data, struct stm_output *output, 13 - unsigned int chan, const char *buf, size_t count) 13 + unsigned int chan, const char *buf, size_t count, 14 + struct stm_source_data *source) 14 15 { 15 16 unsigned int c = output->channel + chan; 16 17 unsigned int m = output->master;
+2 -1
drivers/hwtracing/stm/p_sys-t.c
··· 285 285 } 286 286 287 287 static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output, 288 - unsigned int chan, const char *buf, size_t count) 288 + unsigned int chan, const char *buf, size_t count, 289 + struct stm_source_data *source) 289 290 { 290 291 struct sys_t_output *op = output->pdrv_private; 291 292 unsigned int c = output->channel + chan;
+1 -1
drivers/hwtracing/stm/stm.h
··· 96 96 const char *name; 97 97 ssize_t (*write)(struct stm_data *data, 98 98 struct stm_output *output, unsigned int chan, 99 - const char *buf, size_t count); 99 + const char *buf, size_t count, struct stm_source_data *source); 100 100 void (*policy_node_init)(void *arg); 101 101 int (*output_open)(void *priv, struct stm_output *output); 102 102 void (*output_close)(struct stm_output *output);