title: (Linux Kernel) Adding new functions in available_filter_functions
body: <p>Hardware - Raspberry pi 4 Model B 8GB
  OS - Raspberry pi OS Buster(10)(2020-05-27-raspios-buster-full-armhf.img)(linux kerenl 4.19.y)</p>
  <p>I added rpi_get_interrupt_info() and modified show_interrupts() in proc.c</p>
  <p><strong>Full code for rpi_get_interrupt_info() and show_interrupts()</strong></p>
  <pre><code>void rpi_get_interrupt_info(struct irqaction *action_p)
  {
      unsigned int irq_num = action_p-&gt;irq;
      void *irq_handler = NULL;
      
      if (action_p-&gt;handler) {
          irq_handler = (void*)action_p-&gt;handler;
      }
  
      if (irq_handler) {
          trace_printk(&quot;[%s] %d: %s, irq_handler: %pS \n&quot;,
                          current-&gt;comm, irq_num, action_p-&gt;name, irq_handler);
      }
  }
      
  int show_interrupts(struct seq_file *p, void *v)
  {
      static int prec;
  
      unsigned long flags, any_count = 0;
      int i = *(loff_t *) v, j;
      struct irqaction *action;
      struct irq_desc *desc;
  
      if (i &gt; ACTUAL_NR_IRQS)
          return 0;
  
      if (i == ACTUAL_NR_IRQS)
          return arch_show_interrupts(p, prec);
  
      /* print header and calculate the width of the first column */
      if (i == 0) {
          for (prec = 3, j = 1000; prec &lt; 10 &amp;&amp; j &lt;= nr_irqs; ++prec)
              j *= 10;
  
          seq_printf(p, &quot;%*s&quot;, prec + 8, &quot;&quot;);
          for_each_online_cpu(j)
              seq_printf(p, &quot;CPU%-8d&quot;, j);
          seq_putc(p, '\n');
      }
  
      rcu_read_lock();
      desc = irq_to_desc(i);
      if (!desc)
          goto outsparse;
  
      if (desc-&gt;kstat_irqs)
          for_each_online_cpu(j)
              any_count |= *per_cpu_ptr(desc-&gt;kstat_irqs, j);
  
      if ((!desc-&gt;action || irq_desc_is_chained(desc)) &amp;&amp; !any_count)
          goto outsparse;
  
      seq_printf(p, &quot;%*d: &quot;, prec, i);
      for_each_online_cpu(j)
          seq_printf(p, &quot;%10u &quot;, desc-&gt;kstat_irqs ?
                      *per_cpu_ptr(desc-&gt;kstat_irqs, j) : 0);
  
      raw_spin_lock_irqsave(&amp;desc-&gt;lock, flags);
      if (desc-&gt;irq_data.chip) {
          if (desc-&gt;irq_data.chip-&gt;irq_print_chip)
              desc-&gt;irq_data.chip-&gt;irq_print_chip(&amp;desc-&gt;irq_data, p);
          else if (desc-&gt;irq_data.chip-&gt;name)
              seq_printf(p, &quot; %8s&quot;, desc-&gt;irq_data.chip-&gt;name);
          else
              seq_printf(p, &quot; %8s&quot;, &quot;-&quot;);
      } else {
          seq_printf(p, &quot; %8s&quot;, &quot;None&quot;);
      }
      if (desc-&gt;irq_data.domain)
          seq_printf(p, &quot; %*d&quot;, prec, (int) desc-&gt;irq_data.hwirq);
      else
          seq_printf(p, &quot; %*s&quot;, prec, &quot;&quot;);
  #ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
      seq_printf(p, &quot; %-8s&quot;, irqd_is_level_type(&amp;desc-&gt;irq_data) ? &quot;Level&quot; : &quot;Edge&quot;);
  #endif
      if (desc-&gt;name)
          seq_printf(p, &quot;-%-8s&quot;, desc-&gt;name);
  
      action = desc-&gt;action;
  
      if (action)
          rpi_get_interrupt_info(action);
  
      if (action) {
          seq_printf(p, &quot;  %s&quot;, action-&gt;name);
          while ((action = action-&gt;next) != NULL)
              seq_printf(p, &quot;, %s&quot;, action-&gt;name);
      }
  
      seq_putc(p, '\n');
      raw_spin_unlock_irqrestore(&amp;desc-&gt;lock, flags);
  outsparse:
      rcu_read_unlock();
      return 0;
  }
  #endif
  </code></pre>
  <p><strong>Code that I changed</strong></p>
  <pre><code>void rpi_get_interrupt_info(struct irqaction *action_p)
  {
      unsigned int irq_num = action_p-&gt;irq;
      void *irq_handler = NULL;
      
      if (action_p-&gt;handler) {
          irq_handler = (void*)action_p-&gt;handler;
      }
  
      if (irq_handler) {
          trace_printk(&quot;[%s] %d: %s, irq_handler: %pS \n&quot;,
                          current-&gt;comm, irq_num, action_p-&gt;name, irq_handler);
      }
  }
  
  ....
  
  if (action)
          rpi_get_interrupt_info(action);
  </code></pre>
  <p>When I try
  <code>echo rpi_get_interrupt_info &gt; /sys/kernel/debug/tracing/set_ftrace_filter</code>,</p>
  <p>an error occurs:
  <code>echo: write error: Invalid argument</code></p>
  <p>So I looked /sys/kernel/debug/tracing/available_filter_functions, and there's no rpi_get_interrupt_info</p>
  <p>I tried <code>noinline void rpi_get_interrupt_info(struct irqaction *action_p)</code>, but it doesn't work.</p>