~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/tracing/rtla/src/utils.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/tracing/rtla/src/utils.h (Architecture mips) and /tools/tracing/rtla/src/utils.h (Architecture i386)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2                                                     2 
  3 #include <stdint.h>                                 3 #include <stdint.h>
  4 #include <time.h>                                   4 #include <time.h>
  5 #include <sched.h>                                  5 #include <sched.h>
  6                                                     6 
  7 /*                                                  7 /*
  8  * '18446744073709551615\0'                         8  * '18446744073709551615\0'
  9  */                                                 9  */
 10 #define BUFF_U64_STR_SIZE       24                 10 #define BUFF_U64_STR_SIZE       24
 11 #define MAX_PATH                1024               11 #define MAX_PATH                1024
 12 #define MAX_NICE                20                 12 #define MAX_NICE                20
 13 #define MIN_NICE                -19                13 #define MIN_NICE                -19
 14                                                    14 
 15 #define container_of(ptr, type, member)({          15 #define container_of(ptr, type, member)({                       \
 16         const typeof(((type *)0)->member) *__m     16         const typeof(((type *)0)->member) *__mptr = (ptr);      \
 17         (type *)((char *)__mptr - offsetof(typ     17         (type *)((char *)__mptr - offsetof(type, member)) ; })
 18                                                    18 
 19 extern int config_debug;                           19 extern int config_debug;
 20 void debug_msg(const char *fmt, ...);              20 void debug_msg(const char *fmt, ...);
 21 void err_msg(const char *fmt, ...);                21 void err_msg(const char *fmt, ...);
 22                                                    22 
 23 long parse_seconds_duration(char *val);            23 long parse_seconds_duration(char *val);
 24 void get_duration(time_t start_time, char *out     24 void get_duration(time_t start_time, char *output, int output_size);
 25                                                    25 
 26 int parse_cpu_list(char *cpu_list, char **moni     26 int parse_cpu_list(char *cpu_list, char **monitored_cpus);
 27 long long get_llong_from_str(char *start);         27 long long get_llong_from_str(char *start);
 28                                                    28 
 29 static inline void                                 29 static inline void
 30 update_min(unsigned long long *a, unsigned lon     30 update_min(unsigned long long *a, unsigned long long *b)
 31 {                                                  31 {
 32         if (*a > *b)                               32         if (*a > *b)
 33                 *a = *b;                           33                 *a = *b;
 34 }                                                  34 }
 35                                                    35 
 36 static inline void                                 36 static inline void
 37 update_max(unsigned long long *a, unsigned lon     37 update_max(unsigned long long *a, unsigned long long *b)
 38 {                                                  38 {
 39         if (*a < *b)                               39         if (*a < *b)
 40                 *a = *b;                           40                 *a = *b;
 41 }                                                  41 }
 42                                                    42 
 43 static inline void                                 43 static inline void
 44 update_sum(unsigned long long *a, unsigned lon     44 update_sum(unsigned long long *a, unsigned long long *b)
 45 {                                                  45 {
 46         *a += *b;                                  46         *a += *b;
 47 }                                                  47 }
 48                                                    48 
 49 struct sched_attr {                                49 struct sched_attr {
 50         uint32_t size;                             50         uint32_t size;
 51         uint32_t sched_policy;                     51         uint32_t sched_policy;
 52         uint64_t sched_flags;                      52         uint64_t sched_flags;
 53         int32_t sched_nice;                        53         int32_t sched_nice;
 54         uint32_t sched_priority;                   54         uint32_t sched_priority;
 55         uint64_t sched_runtime;                    55         uint64_t sched_runtime;
 56         uint64_t sched_deadline;                   56         uint64_t sched_deadline;
 57         uint64_t sched_period;                     57         uint64_t sched_period;
 58 };                                                 58 };
 59                                                    59 
 60 int parse_prio(char *arg, struct sched_attr *s     60 int parse_prio(char *arg, struct sched_attr *sched_param);
 61 int parse_cpu_set(char *cpu_list, cpu_set_t *s     61 int parse_cpu_set(char *cpu_list, cpu_set_t *set);
 62 int __set_sched_attr(int pid, struct sched_att     62 int __set_sched_attr(int pid, struct sched_attr *attr);
 63 int set_comm_sched_attr(const char *comm_prefi     63 int set_comm_sched_attr(const char *comm_prefix, struct sched_attr *attr);
 64 int set_comm_cgroup(const char *comm_prefix, c     64 int set_comm_cgroup(const char *comm_prefix, const char *cgroup);
 65 int set_pid_cgroup(pid_t pid, const char *cgro     65 int set_pid_cgroup(pid_t pid, const char *cgroup);
 66 int set_cpu_dma_latency(int32_t latency);          66 int set_cpu_dma_latency(int32_t latency);
 67 int auto_house_keeping(cpu_set_t *monitored_cp     67 int auto_house_keeping(cpu_set_t *monitored_cpus);
 68                                                    68 
 69 #define ns_to_usf(x) (((double)x/1000))            69 #define ns_to_usf(x) (((double)x/1000))
 70 #define ns_to_per(total, part) ((part * 100) /     70 #define ns_to_per(total, part) ((part * 100) / (double)total)
 71                                                    71 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php