irqbalance/feature-add-test-interfaces-for-irqbalance-core-functions.patch
2019-12-25 22:08:07 +08:00

80 lines
2.1 KiB
Diff

From 6f90062816b218809dc5d1e06ac7e0f7198368d6 Mon Sep 17 00:00:00 2001
From: hejingxian <hejingxian@huawei.com>
Date: Sun, 10 Nov 2019 17:24:43 +0800
Subject: [PATCH] Add test interfaces for irqbalance core functions
There exists some core functions which can't be called by llt. Therefore,
we add external functions for user calling the core functions.
---
classify.c | 7 +++++++
procinterrupts.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/classify.c b/classify.c
index 3921710..5aed9e5 100644
--- a/classify.c
+++ b/classify.c
@@ -1068,3 +1068,10 @@ int is_pci_assigned_irq(const char *line)
return 0;
}
+
+#ifdef TEST
+void get_irq_user_policy_test(char *path, int irq, struct user_irq_policy *pol)
+{
+ get_irq_user_policy(path, irq, pol);
+}
+#endif
diff --git a/procinterrupts.c b/procinterrupts.c
index 59df6d7..cd99f35 100644
--- a/procinterrupts.c
+++ b/procinterrupts.c
@@ -148,6 +148,18 @@ static void guess_arm_irq_hints(char *name, struct irq_info *info)
}
+#ifdef TEST
+void guess_arm_irq_hints_test(char *name, struct irq_info *info)
+{
+ guess_arm_irq_hints(name, info);
+}
+
+int check_platform_device_test(char *name, struct irq_info *info)
+{
+ return check_platform_device(name, info);
+}
+#endif
+
/*
* This check is only invoked at service startup, and avoid any impact on the system,
* The scheme just only reads the irq's aff, and write it back. According to the result
@@ -674,3 +686,25 @@ void parse_proc_stat(void)
for_each_object(numa_nodes, compute_irq_branch_load_share, NULL);
}
+
+#ifdef TEST
+void init_irq_class_and_type_test(char *savedline, struct irq_info *info, int irq)
+{
+ init_irq_class_and_type(savedline, info, irq);
+}
+
+void set_load_test(struct topo_obj *d, void *data __attribute__((unused)))
+{
+ set_load(d, data);
+}
+
+void compute_irq_branch_load_share_test(struct topo_obj *d, void *data __attribute__((unused)))
+{
+ compute_irq_branch_load_share(d, data);
+}
+
+void accumulate_interrupts_test(struct topo_obj *d, void *data __attribute__((unused)))
+{
+ accumulate_interrupts(d, data);
+}
+#endif
--
1.8.3.1