18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef PERF_UNIT_H 38c2ecf20Sopenharmony_ci#define PERF_UNIT_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <stddef.h> 68c2ecf20Sopenharmony_ci#include <linux/types.h> 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_cistruct parse_tag { 98c2ecf20Sopenharmony_ci char tag; 108c2ecf20Sopenharmony_ci int mult; 118c2ecf20Sopenharmony_ci}; 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciunsigned long parse_tag_value(const char *str, struct parse_tag *tags); 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciunsigned long convert_unit(unsigned long value, char *unit); 168c2ecf20Sopenharmony_ciint unit_number__scnprintf(char *buf, size_t size, u64 n); 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#endif /* PERF_UNIT_H */ 19