Path: blob/master/tools/power/x86/intel-speed-select/isst-display.c
26295 views
// SPDX-License-Identifier: GPL-2.01/*2* Intel dynamic_speed_select -- Enumerate and control features3* Copyright (c) 2019 Intel Corporation.4*/56#include "isst.h"78static void printcpulist(int str_len, char *str, int mask_size,9cpu_set_t *cpu_mask)10{11int i, first, curr_index, index;1213if (!CPU_COUNT_S(mask_size, cpu_mask)) {14snprintf(str, str_len, "none");15return;16}1718curr_index = 0;19first = 1;20for (i = 0; i < get_topo_max_cpus(); ++i) {21if (!CPU_ISSET_S(i, mask_size, cpu_mask))22continue;23if (!first) {24index = snprintf(&str[curr_index],25str_len - curr_index, ",");26curr_index += index;27if (curr_index >= str_len)28break;29}30index = snprintf(&str[curr_index], str_len - curr_index, "%d",31i);32curr_index += index;33if (curr_index >= str_len)34break;35first = 0;36}37}3839static void printcpumask(int str_len, char *str, int mask_size,40cpu_set_t *cpu_mask)41{42int i, max_cpus = get_topo_max_cpus();43unsigned int *mask;44int size, index, curr_index;4546size = max_cpus / (sizeof(unsigned int) * 8);47if (max_cpus % (sizeof(unsigned int) * 8))48size++;4950mask = calloc(size, sizeof(unsigned int));51if (!mask)52return;5354for (i = 0; i < max_cpus; ++i) {55int mask_index, bit_index;5657if (!CPU_ISSET_S(i, mask_size, cpu_mask))58continue;5960mask_index = i / (sizeof(unsigned int) * 8);61bit_index = i % (sizeof(unsigned int) * 8);62mask[mask_index] |= BIT(bit_index);63}6465curr_index = 0;66for (i = size - 1; i >= 0; --i) {67index = snprintf(&str[curr_index], str_len - curr_index, "%08x",68mask[i]);69curr_index += index;70if (curr_index >= str_len)71break;72if (i) {73strncat(&str[curr_index], ",", str_len - curr_index);74curr_index++;75}76if (curr_index >= str_len)77break;78}7980free(mask);81}8283static void format_and_print_txt(FILE *outf, int level, char *header,84char *value)85{86char *spaces = " ";87static char delimiters[256];88int i, j = 0;8990if (!level)91return;9293if (level == 1) {94strcpy(delimiters, " ");95} else {96for (i = 0; i < level - 1; ++i)97j += snprintf(&delimiters[j], sizeof(delimiters) - j,98"%s", spaces);99}100101if (header && value) {102fprintf(outf, "%s", delimiters);103fprintf(outf, "%s:%s\n", header, value);104} else if (header) {105fprintf(outf, "%s", delimiters);106fprintf(outf, "%s\n", header);107}108}109110static int last_level;111static void format_and_print(FILE *outf, int level, char *header, char *value)112{113char *spaces = " ";114static char delimiters[256];115int i;116117if (!out_format_is_json()) {118format_and_print_txt(outf, level, header, value);119return;120}121122if (level == 0) {123if (header)124fprintf(outf, "{");125else126fprintf(outf, "\n}\n");127128} else {129int j = 0;130131for (i = 0; i < level; ++i)132j += snprintf(&delimiters[j], sizeof(delimiters) - j,133"%s", spaces);134135if (last_level == level)136fprintf(outf, ",\n");137138if (value) {139if (last_level != level)140fprintf(outf, "\n");141142fprintf(outf, "%s\"%s\": ", delimiters, header);143fprintf(outf, "\"%s\"", value);144} else {145for (i = last_level - 1; i >= level; --i) {146int k = 0;147148for (j = i; j > 0; --j)149k += snprintf(&delimiters[k],150sizeof(delimiters) - k,151"%s", spaces);152if (i == level && header)153fprintf(outf, "\n%s},", delimiters);154else155fprintf(outf, "\n%s}", delimiters);156}157if (abs(last_level - level) < 3)158fprintf(outf, "\n");159if (header)160fprintf(outf, "%s\"%s\": {", delimiters,161header);162}163}164165last_level = level;166}167168static int print_package_info(struct isst_id *id, FILE *outf)169{170char header[256];171int level = 1;172173if (out_format_is_json()) {174if (api_version() > 1) {175if (id->die < 0 && id->cpu < 0)176snprintf(header, sizeof(header),177"package-%d:die-IO:powerdomain-%d:cpu-None",178id->pkg, id->punit);179else if (id->cpu < 0)180snprintf(header, sizeof(header),181"package-%d:die-%d:powerdomain-%d:cpu-None",182id->pkg, id->die, id->punit);183else184snprintf(header, sizeof(header),185"package-%d:die-%d:powerdomain-%d:cpu-%d",186id->pkg, id->die, id->punit, id->cpu);187} else {188snprintf(header, sizeof(header), "package-%d:die-%d:cpu-%d",189id->pkg, id->die, id->cpu);190}191format_and_print(outf, level, header, NULL);192return 1;193}194snprintf(header, sizeof(header), "package-%d", id->pkg);195format_and_print(outf, level++, header, NULL);196if (id->die < 0)197snprintf(header, sizeof(header), "die-IO");198else199snprintf(header, sizeof(header), "die-%d", id->die);200format_and_print(outf, level++, header, NULL);201if (api_version() > 1) {202snprintf(header, sizeof(header), "powerdomain-%d", id->punit);203format_and_print(outf, level++, header, NULL);204}205206if (id->cpu < 0)207snprintf(header, sizeof(header), "cpu-None");208else209snprintf(header, sizeof(header), "cpu-%d", id->cpu);210211format_and_print(outf, level, header, NULL);212213return level;214}215216static void _isst_pbf_display_information(struct isst_id *id, FILE *outf, int level,217struct isst_pbf_info *pbf_info,218int disp_level)219{220static char header[256];221static char value[1024];222223snprintf(header, sizeof(header), "speed-select-base-freq-properties");224format_and_print(outf, disp_level, header, NULL);225226snprintf(header, sizeof(header), "high-priority-base-frequency(MHz)");227snprintf(value, sizeof(value), "%d",228pbf_info->p1_high * isst_get_disp_freq_multiplier());229format_and_print(outf, disp_level + 1, header, value);230231snprintf(header, sizeof(header), "high-priority-cpu-mask");232printcpumask(sizeof(value), value, pbf_info->core_cpumask_size,233pbf_info->core_cpumask);234format_and_print(outf, disp_level + 1, header, value);235236snprintf(header, sizeof(header), "high-priority-cpu-list");237printcpulist(sizeof(value), value,238pbf_info->core_cpumask_size,239pbf_info->core_cpumask);240format_and_print(outf, disp_level + 1, header, value);241242snprintf(header, sizeof(header), "low-priority-base-frequency(MHz)");243snprintf(value, sizeof(value), "%d",244pbf_info->p1_low * isst_get_disp_freq_multiplier());245format_and_print(outf, disp_level + 1, header, value);246247if (is_clx_n_platform())248return;249250snprintf(header, sizeof(header), "tjunction-temperature(C)");251snprintf(value, sizeof(value), "%d", pbf_info->t_prochot);252format_and_print(outf, disp_level + 1, header, value);253254snprintf(header, sizeof(header), "thermal-design-power(W)");255snprintf(value, sizeof(value), "%d", pbf_info->tdp);256format_and_print(outf, disp_level + 1, header, value);257}258259static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int level,260int fact_bucket, int fact_avx,261struct isst_fact_info *fact_info,262int base_level)263{264struct isst_fact_bucket_info *bucket_info = fact_info->bucket_info;265int trl_max_levels = isst_get_trl_max_levels();266char header[256];267char value[256];268int print = 0, j;269270for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) {271if (fact_bucket != 0xff && fact_bucket != j)272continue;273274/* core count must be valid for CPU power domain */275if (!bucket_info[j].hp_cores && id->cpu >= 0)276break;277278print = 1;279}280if (!print) {281fprintf(stderr, "Invalid bucket\n");282return;283}284285snprintf(header, sizeof(header), "speed-select-turbo-freq-properties");286format_and_print(outf, base_level, header, NULL);287for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) {288int i;289290if (fact_bucket != 0xff && fact_bucket != j)291continue;292293if (!bucket_info[j].hp_cores)294break;295296snprintf(header, sizeof(header), "bucket-%d", j);297format_and_print(outf, base_level + 1, header, NULL);298299snprintf(header, sizeof(header), "high-priority-cores-count");300snprintf(value, sizeof(value), "%d",301bucket_info[j].hp_cores);302format_and_print(outf, base_level + 2, header, value);303for (i = 0; i < trl_max_levels; i++) {304if (!bucket_info[j].hp_ratios[i] || (fact_avx != 0xFF && !(fact_avx & (1 << i))))305continue;306if (i == 0 && api_version() == 1 && !is_emr_platform())307snprintf(header, sizeof(header),308"high-priority-max-frequency(MHz)");309else310snprintf(header, sizeof(header),311"high-priority-max-%s-frequency(MHz)", isst_get_trl_level_name(i));312snprintf(value, sizeof(value), "%d",313bucket_info[j].hp_ratios[i] * isst_get_disp_freq_multiplier());314format_and_print(outf, base_level + 2, header, value);315}316}317snprintf(header, sizeof(header),318"speed-select-turbo-freq-clip-frequencies");319format_and_print(outf, base_level + 1, header, NULL);320321for (j = 0; j < trl_max_levels; j++) {322if (!fact_info->lp_ratios[j])323continue;324325/* No AVX level name for SSE to be consistent with previous formatting */326if (j == 0 && api_version() == 1 && !is_emr_platform())327snprintf(header, sizeof(header), "low-priority-max-frequency(MHz)");328else329snprintf(header, sizeof(header), "low-priority-max-%s-frequency(MHz)",330isst_get_trl_level_name(j));331snprintf(value, sizeof(value), "%d",332fact_info->lp_ratios[j] * isst_get_disp_freq_multiplier());333format_and_print(outf, base_level + 2, header, value);334}335}336337void isst_ctdp_display_core_info(struct isst_id *id, FILE *outf, char *prefix,338unsigned int val, char *str0, char *str1)339{340char value[256];341int level = print_package_info(id, outf);342343level++;344345if (str0 && !val)346snprintf(value, sizeof(value), "%s", str0);347else if (str1 && val)348snprintf(value, sizeof(value), "%s", str1);349else350snprintf(value, sizeof(value), "%u", val);351format_and_print(outf, level, prefix, value);352353format_and_print(outf, 1, NULL, NULL);354}355356void isst_ctdp_display_information(struct isst_id *id, FILE *outf, int tdp_level,357struct isst_pkg_ctdp *pkg_dev)358{359static char header[256];360static char value[1024];361static int level;362int trl_max_levels = isst_get_trl_max_levels();363int i;364365if (pkg_dev->processed)366level = print_package_info(id, outf);367368for (i = 0; i <= pkg_dev->levels; ++i) {369struct isst_pkg_ctdp_level_info *ctdp_level;370int j, k;371372ctdp_level = &pkg_dev->ctdp_level[i];373if (!ctdp_level->processed)374continue;375376snprintf(header, sizeof(header), "perf-profile-level-%d",377ctdp_level->level);378format_and_print(outf, level + 1, header, NULL);379380if (id->cpu >= 0) {381snprintf(header, sizeof(header), "cpu-count");382j = get_cpu_count(id);383snprintf(value, sizeof(value), "%d", j);384format_and_print(outf, level + 2, header, value);385386j = CPU_COUNT_S(ctdp_level->core_cpumask_size,387ctdp_level->core_cpumask);388if (j) {389snprintf(header, sizeof(header), "enable-cpu-count");390snprintf(value, sizeof(value), "%d", j);391format_and_print(outf, level + 2, header, value);392}393394if (ctdp_level->core_cpumask_size) {395snprintf(header, sizeof(header), "enable-cpu-mask");396printcpumask(sizeof(value), value,397ctdp_level->core_cpumask_size,398ctdp_level->core_cpumask);399format_and_print(outf, level + 2, header, value);400401snprintf(header, sizeof(header), "enable-cpu-list");402printcpulist(sizeof(value), value,403ctdp_level->core_cpumask_size,404ctdp_level->core_cpumask);405format_and_print(outf, level + 2, header, value);406}407}408409snprintf(header, sizeof(header), "thermal-design-power-ratio");410snprintf(value, sizeof(value), "%d", ctdp_level->tdp_ratio);411format_and_print(outf, level + 2, header, value);412413snprintf(header, sizeof(header), "base-frequency(MHz)");414if (!ctdp_level->sse_p1)415ctdp_level->sse_p1 = ctdp_level->tdp_ratio;416snprintf(value, sizeof(value), "%d",417ctdp_level->sse_p1 * isst_get_disp_freq_multiplier());418format_and_print(outf, level + 2, header, value);419420if (ctdp_level->avx2_p1) {421snprintf(header, sizeof(header), "base-frequency-avx2(MHz)");422snprintf(value, sizeof(value), "%d",423ctdp_level->avx2_p1 * isst_get_disp_freq_multiplier());424format_and_print(outf, level + 2, header, value);425}426427if (ctdp_level->avx512_p1) {428snprintf(header, sizeof(header), "base-frequency-avx512(MHz)");429snprintf(value, sizeof(value), "%d",430ctdp_level->avx512_p1 * isst_get_disp_freq_multiplier());431format_and_print(outf, level + 2, header, value);432}433434if (ctdp_level->uncore_pm) {435snprintf(header, sizeof(header), "uncore-frequency-min(MHz)");436snprintf(value, sizeof(value), "%d",437ctdp_level->uncore_pm * isst_get_disp_freq_multiplier());438format_and_print(outf, level + 2, header, value);439}440441if (ctdp_level->uncore_p0) {442snprintf(header, sizeof(header), "uncore-frequency-max(MHz)");443snprintf(value, sizeof(value), "%d",444ctdp_level->uncore_p0 * isst_get_disp_freq_multiplier());445format_and_print(outf, level + 2, header, value);446}447448if (ctdp_level->amx_p1) {449snprintf(header, sizeof(header), "base-frequency-amx(MHz)");450snprintf(value, sizeof(value), "%d",451ctdp_level->amx_p1 * isst_get_disp_freq_multiplier());452format_and_print(outf, level + 2, header, value);453}454455if (ctdp_level->uncore_p1) {456snprintf(header, sizeof(header), "uncore-frequency-base(MHz)");457snprintf(value, sizeof(value), "%d",458ctdp_level->uncore_p1 * isst_get_disp_freq_multiplier());459format_and_print(outf, level + 2, header, value);460}461462if (ctdp_level->uncore1_p1) {463snprintf(header, sizeof(header), "uncore-1-frequency-base(MHz)");464snprintf(value, sizeof(value), "%d",465ctdp_level->uncore1_p1 * isst_get_disp_freq_multiplier());466format_and_print(outf, level + 2, header, value);467}468if (ctdp_level->uncore1_pm) {469snprintf(header, sizeof(header), "uncore-1-frequency-min(MHz)");470snprintf(value, sizeof(value), "%d",471ctdp_level->uncore1_pm * isst_get_disp_freq_multiplier());472format_and_print(outf, level + 2, header, value);473}474475if (ctdp_level->uncore1_p0) {476snprintf(header, sizeof(header), "uncore-1-frequency-max(MHz)");477snprintf(value, sizeof(value), "%d",478ctdp_level->uncore1_p0 * isst_get_disp_freq_multiplier());479format_and_print(outf, level + 2, header, value);480}481482if (ctdp_level->mem_freq) {483snprintf(header, sizeof(header), "max-mem-frequency(MHz)");484snprintf(value, sizeof(value), "%d",485ctdp_level->mem_freq);486format_and_print(outf, level + 2, header, value);487}488489if (api_version() > 1) {490snprintf(header, sizeof(header), "cooling_type");491snprintf(value, sizeof(value), "%d",492ctdp_level->cooling_type);493format_and_print(outf, level + 2, header, value);494}495496snprintf(header, sizeof(header),497"speed-select-turbo-freq");498if (ctdp_level->fact_support) {499if (ctdp_level->fact_enabled)500snprintf(value, sizeof(value), "enabled");501else502snprintf(value, sizeof(value), "disabled");503} else504snprintf(value, sizeof(value), "unsupported");505format_and_print(outf, level + 2, header, value);506507snprintf(header, sizeof(header),508"speed-select-base-freq");509if (ctdp_level->pbf_support) {510if (ctdp_level->pbf_enabled)511snprintf(value, sizeof(value), "enabled");512else513snprintf(value, sizeof(value), "disabled");514} else515snprintf(value, sizeof(value), "unsupported");516format_and_print(outf, level + 2, header, value);517518snprintf(header, sizeof(header),519"speed-select-core-power");520if (ctdp_level->sst_cp_support) {521if (ctdp_level->sst_cp_enabled)522snprintf(value, sizeof(value), "enabled");523else524snprintf(value, sizeof(value), "disabled");525} else526snprintf(value, sizeof(value), "unsupported");527format_and_print(outf, level + 2, header, value);528529if (is_clx_n_platform()) {530if (ctdp_level->pbf_support)531_isst_pbf_display_information(id, outf,532tdp_level,533&ctdp_level->pbf_info,534level + 2);535continue;536}537538if (ctdp_level->pkg_tdp) {539snprintf(header, sizeof(header), "thermal-design-power(W)");540snprintf(value, sizeof(value), "%d", ctdp_level->pkg_tdp);541format_and_print(outf, level + 2, header, value);542}543544if (ctdp_level->t_proc_hot) {545snprintf(header, sizeof(header), "tjunction-max(C)");546snprintf(value, sizeof(value), "%d", ctdp_level->t_proc_hot);547format_and_print(outf, level + 2, header, value);548}549550for (k = 0; k < trl_max_levels; k++) {551if (!ctdp_level->trl_ratios[k][0])552continue;553554snprintf(header, sizeof(header), "turbo-ratio-limits-%s", isst_get_trl_level_name(k));555format_and_print(outf, level + 2, header, NULL);556557for (j = 0; j < 8; ++j) {558snprintf(header, sizeof(header), "bucket-%d", j);559format_and_print(outf, level + 3, header, NULL);560561snprintf(header, sizeof(header), "core-count");562563snprintf(value, sizeof(value), "%llu", (ctdp_level->trl_cores >> (j * 8)) & 0xff);564format_and_print(outf, level + 4, header, value);565566snprintf(header, sizeof(header), "max-turbo-frequency(MHz)");567snprintf(value, sizeof(value), "%d", ctdp_level->trl_ratios[k][j] * isst_get_disp_freq_multiplier());568format_and_print(outf, level + 4, header, value);569}570}571572if (ctdp_level->pbf_support)573_isst_pbf_display_information(id, outf, i,574&ctdp_level->pbf_info,575level + 2);576if (ctdp_level->fact_support)577_isst_fact_display_information(id, outf, i, 0xff, 0xff,578&ctdp_level->fact_info,579level + 2);580}581582format_and_print(outf, 1, NULL, NULL);583}584585static int start;586void isst_ctdp_display_information_start(FILE *outf)587{588last_level = 0;589format_and_print(outf, 0, "start", NULL);590start = 1;591}592593void isst_ctdp_display_information_end(FILE *outf)594{595format_and_print(outf, 0, NULL, NULL);596start = 0;597}598599void isst_pbf_display_information(struct isst_id *id, FILE *outf, int level,600struct isst_pbf_info *pbf_info)601{602int _level;603604_level = print_package_info(id, outf);605_isst_pbf_display_information(id, outf, level, pbf_info, _level + 1);606format_and_print(outf, 1, NULL, NULL);607}608609void isst_fact_display_information(struct isst_id *id, FILE *outf, int level,610int fact_bucket, int fact_avx,611struct isst_fact_info *fact_info)612{613int _level;614615_level = print_package_info(id, outf);616_isst_fact_display_information(id, outf, level, fact_bucket, fact_avx,617fact_info, _level + 1);618format_and_print(outf, 1, NULL, NULL);619}620621void isst_clos_display_information(struct isst_id *id, FILE *outf, int clos,622struct isst_clos_config *clos_config)623{624char header[256];625char value[256];626int level;627628level = print_package_info(id, outf);629630snprintf(header, sizeof(header), "core-power");631format_and_print(outf, level + 1, header, NULL);632633snprintf(header, sizeof(header), "clos");634snprintf(value, sizeof(value), "%d", clos);635format_and_print(outf, level + 2, header, value);636637snprintf(header, sizeof(header), "epp");638snprintf(value, sizeof(value), "%d", clos_config->epp);639format_and_print(outf, level + 2, header, value);640641snprintf(header, sizeof(header), "clos-proportional-priority");642snprintf(value, sizeof(value), "%d", clos_config->clos_prop_prio);643format_and_print(outf, level + 2, header, value);644645snprintf(header, sizeof(header), "clos-min");646snprintf(value, sizeof(value), "%d MHz", clos_config->clos_min * isst_get_disp_freq_multiplier());647format_and_print(outf, level + 2, header, value);648649snprintf(header, sizeof(header), "clos-max");650if ((clos_config->clos_max * isst_get_disp_freq_multiplier()) == 25500)651snprintf(value, sizeof(value), "Max Turbo frequency");652else653snprintf(value, sizeof(value), "%d MHz", clos_config->clos_max * isst_get_disp_freq_multiplier());654format_and_print(outf, level + 2, header, value);655656snprintf(header, sizeof(header), "clos-desired");657snprintf(value, sizeof(value), "%d MHz", clos_config->clos_desired * isst_get_disp_freq_multiplier());658format_and_print(outf, level + 2, header, value);659660format_and_print(outf, level, NULL, NULL);661}662663void isst_clos_display_clos_information(struct isst_id *id, FILE *outf,664int clos_enable, int type,665int state, int cap)666{667char header[256];668char value[256];669int level;670671level = print_package_info(id, outf);672673snprintf(header, sizeof(header), "core-power");674format_and_print(outf, level + 1, header, NULL);675676snprintf(header, sizeof(header), "support-status");677if (cap)678snprintf(value, sizeof(value), "supported");679else680snprintf(value, sizeof(value), "unsupported");681format_and_print(outf, level + 2, header, value);682683snprintf(header, sizeof(header), "enable-status");684if (state)685snprintf(value, sizeof(value), "enabled");686else687snprintf(value, sizeof(value), "disabled");688format_and_print(outf, level + 2, header, value);689690snprintf(header, sizeof(header), "clos-enable-status");691if (clos_enable)692snprintf(value, sizeof(value), "enabled");693else694snprintf(value, sizeof(value), "disabled");695format_and_print(outf, level + 2, header, value);696697snprintf(header, sizeof(header), "priority-type");698if (type)699snprintf(value, sizeof(value), "ordered");700else701snprintf(value, sizeof(value), "proportional");702format_and_print(outf, level + 2, header, value);703704format_and_print(outf, level, NULL, NULL);705}706707void isst_clos_display_assoc_information(struct isst_id *id, FILE *outf, int clos)708{709char header[256];710char value[256];711int level;712713level = print_package_info(id, outf);714715snprintf(header, sizeof(header), "get-assoc");716format_and_print(outf, level + 1, header, NULL);717718snprintf(header, sizeof(header), "clos");719snprintf(value, sizeof(value), "%d", clos);720format_and_print(outf, level + 2, header, value);721722format_and_print(outf, level, NULL, NULL);723}724725void isst_display_result(struct isst_id *id, FILE *outf, char *feature, char *cmd,726int result)727{728char header[256];729char value[256];730int level = 3;731732level = print_package_info(id, outf);733734snprintf(header, sizeof(header), "%s", feature);735format_and_print(outf, level + 1, header, NULL);736snprintf(header, sizeof(header), "%s", cmd);737if (!result)738snprintf(value, sizeof(value), "success");739else740snprintf(value, sizeof(value), "failed(error %d)", result);741format_and_print(outf, level + 2, header, value);742743format_and_print(outf, level, NULL, NULL);744}745746void isst_display_error_info_message(int error, char *msg, int arg_valid, int arg)747{748FILE *outf = get_output_file();749static int error_index;750char header[256];751char value[256];752753if (!out_format_is_json()) {754if (arg_valid)755snprintf(value, sizeof(value), "%s %d", msg, arg);756else757snprintf(value, sizeof(value), "%s", msg);758759if (error)760fprintf(outf, "Error: %s\n", value);761else762fprintf(outf, "Information: %s\n", value);763return;764}765766if (!start)767format_and_print(outf, 0, "start", NULL);768769if (error)770snprintf(header, sizeof(header), "Error%d", error_index++);771else772snprintf(header, sizeof(header), "Information:%d", error_index++);773format_and_print(outf, 1, header, NULL);774775snprintf(header, sizeof(header), "message");776if (arg_valid)777snprintf(value, sizeof(value), "%s %d", msg, arg);778else779snprintf(value, sizeof(value), "%s", msg);780781format_and_print(outf, 2, header, value);782format_and_print(outf, 1, NULL, NULL);783if (!start)784format_and_print(outf, 0, NULL, NULL);785}786787void isst_trl_display_information(struct isst_id *id, FILE *outf, unsigned long long trl)788{789char header[256];790char value[256];791int level;792793level = print_package_info(id, outf);794795snprintf(header, sizeof(header), "get-trl");796format_and_print(outf, level + 1, header, NULL);797798snprintf(header, sizeof(header), "trl");799snprintf(value, sizeof(value), "0x%llx", trl);800format_and_print(outf, level + 2, header, value);801802format_and_print(outf, level, NULL, NULL);803}804805806