From f8744448c9ddeb24eb45eb0e15c15f8aea5988af Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Wed, 7 Oct 2020 17:51:24 +0300 Subject: [PATCH] ignore.txt --- ignore.txt | 253 +++++++++++++++++++++++++++++++++++++++++++++++++++++ srcxray.py | 39 ++------- 2 files changed, 261 insertions(+), 31 deletions(-) create mode 100644 ignore.txt diff --git a/ignore.txt b/ignore.txt new file mode 100644 index 0000000..5acf874 --- /dev/null +++ b/ignore.txt @@ -0,0 +1,253 @@ +AT_FDCWD +BDI_SHOW +BUG +BUG_ON +EAGAIN +EBADF +EBUSY +EFAULT +EINTR +EINVAL +EIO +ENODEV +ENOENT +ENOMEM +ENOSYS +ENOTSUPP +EOPNOTSUPP +EOPNOTSUPP +EPERM +ERR_PTR +ESRCH +FMODE_WRITE +GFP_KERNEL +HPAGE_PMD_NR +INIT_LIST_HEAD +IS_ENABLED +IS_ERR +LOOKUP_EMPTY +LOOKUP_FOLLOW +LOOKUP_REVAL +NAPI_GRO_CB +NODE_DATA +NULL +NUMA_NO_NODE +O_CLOEXEC +O_LARGEFILE +PAGE_MASK +PAGE_SHIFT +PAGE_SIZE +PTR_ERR +PVOP_CALLEE0 +PVOP_VCALLEE0 +PVOP_VCALLEE1 +PageLocked +READ_ONCE +SIGKILL +SIGSTOP +UL +VM_BUG_ON +VM_BUG_ON_PAGE +WARN_ON +WARN_ON_ONCE +XXstart +_RET_IP_ +__user +__user +abort_creds +access_ok +addr +aligned +atomic_read +bool +capable +clear_bit +commit_creds +compound_head +cond_resched +container_of +copy_from_user +copy_to_user +cpu_to_le16 +cpumask_bits +cred +current +current_cred +current_user_ns +d_inode +defined +dput +end +entry +err +error +f_mode +f_path +false +fd_install +fdget +fdput +file_inode +find_task_by_vpid +flags +get_page +get_timespec64 +get_user +getname +i +if +kfree +kzalloc +likely +list +list_add +list_del +list_empty +list_for_each_entry +loff_t +lookup_flags +max +memcpy +memset +min +mutex_lock +mutex_unlock +name +next +nr_pages +ns_capable +offset +old +out +page_to_nid +page_to_pfn +page_zone +path_put +path_put +pci_set_drvdata +percpu_ref_put +pfn +pfn_to_page +pgoff_t +pmd_t +pos +pos_from_hilo +pr_debug +pr_err +pr_info +preempt_disable +preempt_enable +prepare_creds +pte_t +ptl +put_page +put_user +putname +raw_local_irq_save +rcu_read_lock +rcu_read_unlock +read_lock +read_unlock +real_mount +ret +retry +retry_estale +sigdelsetmask +sigset_t +size +size_t +spin_lock +spin_lock_irq +spin_lock_irqsave +spin_unlock +spin_unlock_irq +spin_unlock_irqrestore +spinlock_t +sprintf +ssize_t +ssize_t +swp_entry_t +task_pid_vnr +tasklist_lock +test_bit +trace_hardirqs_off +true +tv_nsec +typeof +u32 +u64 +u8 +unlikely +unlock_page +user_path_at + +spin_lock_init +dev_warn +dev_info +dev_err +printk +dma_set_mask_and_coherent +DMA_BIT_MASK +atomic_inc_return +atomic_dec +BUILD_BUG_ON +offsetof +MAJOR +dev_WARN_ONCE +atomic_dec_return +__field +reset +device_add +__acquires +__releases +get_status +pci_err +msleep +ssleep +pci_dev_put +pci_err +__virtio_test_bit +might_sleep +raw_spin_lock_irqsave +raw_spin_unlock_irqrestore +DECLARE_BITMAP +__set_bit +handler +cmpxchg +barrier +llist_for_each_entry +?panic +atomic_set +ndelay +__clear_bit +__attribute__ +format +_kstrtoul +_kstrtol +kstrtoull +kstrtoll +__alignof__ +local_irq_disable +atomic_cmpxchg +va_start +va_end +atomic_notifier_call_chain +mdelay +local_irq_enable +fprintf +strerror +poweroff +set_bit +pr_fmt +atomic_add +mb +rmb +__get_user +rdtsc +pr_warn +match +__volatile__ +asm +__compiletime_error +assert +tracing_on diff --git a/srcxray.py b/srcxray.py index 8fcd507..ef431e7 100755 --- a/srcxray.py +++ b/srcxray.py @@ -42,37 +42,8 @@ import ast import xml.etree.ElementTree as ET default_root = 'starts' -ignores = ('aligned unlikely typeof u32 ' - 'PVOP_CALLEE0 PVOP_VCALLEE0 PVOP_VCALLEE1 if trace_hardirqs_off ' - 'i NULL likely unlikely true false test_bit NAPI_GRO_CB clear_bit ' - 'atomic_read preempt_disable preempt_enable container_of ENOSYS ' - 'READ_ONCE u64 u8 _RET_IP_ ret current ' - 'AT_FDCWD fdput EBADF file_inode ' - 'ssize_t path_put __user ' - 'list_empty memcpy size_t loff_t pos d_inode dput copy_to_user EIO bool out IS_ERR ' - 'EPERM rcu_read_lock rcu_read_unlock spin_lock spin_unlock list_for_each_entry kfree ' - 'GFP_KERNEL ENOMEM EFAULT ENOENT EAGAIN PTR_ERR PAGE_SHIFT PAGE_SIZE ' - 'pgoff_t pte_t pmd_t HPAGE_PMD_NR PageLocked entry swp_entry_t next unlock_page spinlock_t end XXstart ' - ' VM_BUG_ON VM_BUG_ON_PAGE BDI_SHOW max ' - 'ssize_t path_put __user ' - 'list_del compound_head list_add cond_resched put_page nr_pages min spin_lock_irqsave IS_ENABLED ' - 'EBUSY UL NODE_DATA pr_err memset list size ptl PAGE_MASK pr_info offset addr get_page sprintf ' - 'INIT_LIST_HEAD NUMA_NO_NODE spin_unlock_irqrestore mutex_unlock mutex_lock ' - 'page_to_nid page_to_pfn pfn page_zone pfn_to_page ' - 'BUG BUG_ON flags WARN_ON_ONCE ENODEV cpu_to_le16 cpumask_bits ' - 'ERR_PTR ENOTSUPP EOPNOTSUPP EOPNOTSUPP WARN_ON EINVAL i name ' - 'sigset_t fdget put_user get_user copy_from_user LOOKUP_FOLLOW LOOKUP_EMPTY EINTR ' - 'O_CLOEXEC err getname access_ok task_pid_vnr cred ' - 'percpu_ref_put get_timespec64 sigdelsetmask ns_capable kzalloc capable f_mode O_LARGEFILE pos_from_hilo ' - 'pr_debug error current_cred ESRCH f_path find_task_by_vpid ' - 'retry LOOKUP_REVAL retry_estale user_path_at lookup_flags old ' - 'current_user_ns spin_lock_irq spin_unlock_irq prepare_creds ' - 'tasklist_lock commit_creds read_lock read_unlock SIGKILL SIGSTOP abort_creds fd_install ' - 'real_mount FMODE_WRITE tv_nsec putname ' - ).split() # TODO: move to file - - -level_limit = 10 +ignores = list() +level_limit = 6 limit = 1000 n = 0 cflow_structs = False @@ -1418,6 +1389,12 @@ class _unittest_autotest(unittest.TestCase): def main(): + global ignores + try: + f = open("ignore.txt") + ignores = f.read().splitlines() + except FileNotFoundError: + pass try: ret = False if len(sys.argv) == 1: