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.

Merge tag 'trace-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fix from Steven Rostedt:

- Fix build warning for when MODULES and FTRACE_WITH_DIRECT_CALLS are
not set. A warning happens with ops_references_rec() defined but not
used.

* tag 'trace-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
ftrace: Fix build warning for ops_references_rec() not used

+33 -46
+33 -46
kernel/trace/ftrace.c
··· 1861 1861 ftrace_hash_rec_update_modify(ops, filter_hash, 1); 1862 1862 } 1863 1863 1864 - static bool ops_references_ip(struct ftrace_ops *ops, unsigned long ip); 1865 - 1866 1864 /* 1867 1865 * Try to update IPMODIFY flag on each ftrace_rec. Return 0 if it is OK 1868 1866 * or no-needed to update, -EBUSY if it detects a conflict of the flag ··· 3114 3116 */ 3115 3117 return ftrace_hash_empty(ops->func_hash->filter_hash) && 3116 3118 ftrace_hash_empty(ops->func_hash->notrace_hash); 3117 - } 3118 - 3119 - /* 3120 - * Check if the current ops references the given ip. 3121 - * 3122 - * If the ops traces all functions, then it was already accounted for. 3123 - * If the ops does not trace the current record function, skip it. 3124 - * If the ops ignores the function via notrace filter, skip it. 3125 - */ 3126 - static bool 3127 - ops_references_ip(struct ftrace_ops *ops, unsigned long ip) 3128 - { 3129 - /* If ops isn't enabled, ignore it */ 3130 - if (!(ops->flags & FTRACE_OPS_FL_ENABLED)) 3131 - return false; 3132 - 3133 - /* If ops traces all then it includes this function */ 3134 - if (ops_traces_mod(ops)) 3135 - return true; 3136 - 3137 - /* The function must be in the filter */ 3138 - if (!ftrace_hash_empty(ops->func_hash->filter_hash) && 3139 - !__ftrace_lookup_ip(ops->func_hash->filter_hash, ip)) 3140 - return false; 3141 - 3142 - /* If in notrace hash, we ignore it too */ 3143 - if (ftrace_lookup_ip(ops->func_hash->notrace_hash, ip)) 3144 - return false; 3145 - 3146 - return true; 3147 - } 3148 - 3149 - /* 3150 - * Check if the current ops references the record. 3151 - * 3152 - * If the ops traces all functions, then it was already accounted for. 3153 - * If the ops does not trace the current record function, skip it. 3154 - * If the ops ignores the function via notrace filter, skip it. 3155 - */ 3156 - static bool 3157 - ops_references_rec(struct ftrace_ops *ops, struct dyn_ftrace *rec) 3158 - { 3159 - return ops_references_ip(ops, rec->ip); 3160 3119 } 3161 3120 3162 3121 static int ftrace_update_code(struct module *mod, struct ftrace_page *new_pgs) ··· 6777 6822 return -ERANGE; 6778 6823 } 6779 6824 6825 + #if defined(CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS) || defined(CONFIG_MODULES) 6826 + /* 6827 + * Check if the current ops references the given ip. 6828 + * 6829 + * If the ops traces all functions, then it was already accounted for. 6830 + * If the ops does not trace the current record function, skip it. 6831 + * If the ops ignores the function via notrace filter, skip it. 6832 + */ 6833 + static bool 6834 + ops_references_ip(struct ftrace_ops *ops, unsigned long ip) 6835 + { 6836 + /* If ops isn't enabled, ignore it */ 6837 + if (!(ops->flags & FTRACE_OPS_FL_ENABLED)) 6838 + return false; 6839 + 6840 + /* If ops traces all then it includes this function */ 6841 + if (ops_traces_mod(ops)) 6842 + return true; 6843 + 6844 + /* The function must be in the filter */ 6845 + if (!ftrace_hash_empty(ops->func_hash->filter_hash) && 6846 + !__ftrace_lookup_ip(ops->func_hash->filter_hash, ip)) 6847 + return false; 6848 + 6849 + /* If in notrace hash, we ignore it too */ 6850 + if (ftrace_lookup_ip(ops->func_hash->notrace_hash, ip)) 6851 + return false; 6852 + 6853 + return true; 6854 + } 6855 + #endif 6856 + 6780 6857 #ifdef CONFIG_MODULES 6781 6858 6782 6859 #define next_to_ftrace_page(p) container_of(p, struct ftrace_page, next) ··· 6821 6834 int cnt = 0; 6822 6835 6823 6836 for (ops = ftrace_ops_list; ops != &ftrace_list_end; ops = ops->next) { 6824 - if (ops_references_rec(ops, rec)) { 6837 + if (ops_references_ip(ops, rec->ip)) { 6825 6838 if (WARN_ON_ONCE(ops->flags & FTRACE_OPS_FL_DIRECT)) 6826 6839 continue; 6827 6840 if (WARN_ON_ONCE(ops->flags & FTRACE_OPS_FL_IPMODIFY))