Path: blob/master/samples/coresight/coresight-cfg-sample.c
26278 views
// SPDX-License-Identifier: GPL-2.01/*2* Copyright(C) 2020 Linaro Limited. All rights reserved.3* Author: Mike Leach <[email protected]>4*/56#include "coresight-config.h"7#include "coresight-syscfg.h"89/* create an alternate autofdo configuration */1011/* we will provide 4 sets of preset parameter values */12#define AFDO2_NR_PRESETS 413/* the total number of parameters in used features - strobing has 2 */14#define AFDO2_NR_PARAM_SUM 21516static const char *afdo2_ref_names[] = {17"strobing",18};1920/*21* set of presets leaves strobing window constant while varying period to allow22* experimentation with mark / space ratios for various workloads23*/24static u64 afdo2_presets[AFDO2_NR_PRESETS][AFDO2_NR_PARAM_SUM] = {25{ 1000, 100 },26{ 1000, 1000 },27{ 1000, 5000 },28{ 1000, 10000 },29};3031struct cscfg_config_desc afdo2 = {32.name = "autofdo2",33.description = "Setup ETMs with strobing for autofdo\n"34"Supplied presets allow experimentation with mark-space ratio for various loads\n",35.nr_feat_refs = ARRAY_SIZE(afdo2_ref_names),36.feat_ref_names = afdo2_ref_names,37.nr_presets = AFDO2_NR_PRESETS,38.nr_total_params = AFDO2_NR_PARAM_SUM,39.presets = &afdo2_presets[0][0],40};4142static struct cscfg_feature_desc *sample_feats[] = {43NULL44};4546static struct cscfg_config_desc *sample_cfgs[] = {47&afdo2,48NULL49};5051static struct cscfg_load_owner_info mod_owner = {52.type = CSCFG_OWNER_MODULE,53.owner_handle = THIS_MODULE,54};5556/* module init and exit - just load and unload configs */57static int __init cscfg_sample_init(void)58{59return cscfg_load_config_sets(sample_cfgs, sample_feats, &mod_owner);60}6162static void __exit cscfg_sample_exit(void)63{64cscfg_unload_config_sets(&mod_owner);65}6667module_init(cscfg_sample_init);68module_exit(cscfg_sample_exit);6970MODULE_LICENSE("GPL v2");71MODULE_AUTHOR("Mike Leach <[email protected]>");72MODULE_DESCRIPTION("CoreSight Syscfg Example");737475