Skip to content

Commit f644e36

Browse files
committed
ARC: mm: retire ARC_DBG_TLB_MISS_COUNT...
... given that we have perf counters abel to do the same thing non intrusively Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent c300547 commit f644e36

3 files changed

Lines changed: 0 additions & 139 deletions

File tree

‎arch/arc/Kconfig‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,6 @@ config ARC_DBG_TLB_PARANOIA
540540
bool "Paranoia Checks in Low Level TLB Handlers"
541541
default n
542542

543-
config ARC_DBG_TLB_MISS_COUNT
544-
bool "Profile TLB Misses"
545-
default n
546-
select DEBUG_FS
547-
help
548-
Counts number of I and D TLB Misses and exports them via Debugfs
549-
The counters can be cleared via Debugfs as well
550-
551543
endif
552544

553545
config ARC_UBOOT_SUPPORT

‎arch/arc/kernel/troubleshoot.c‎

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -237,113 +237,3 @@ void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
237237
if (!user_mode(regs))
238238
show_stacktrace(current, regs);
239239
}
240-
241-
#ifdef CONFIG_DEBUG_FS
242-
243-
#include <linux/module.h>
244-
#include <linux/fs.h>
245-
#include <linux/mount.h>
246-
#include <linux/pagemap.h>
247-
#include <linux/init.h>
248-
#include <linux/namei.h>
249-
#include <linux/debugfs.h>
250-
251-
static struct dentry *test_dentry;
252-
static struct dentry *test_dir;
253-
static struct dentry *test_u32_dentry;
254-
255-
static u32 clr_on_read = 1;
256-
257-
#ifdef CONFIG_ARC_DBG_TLB_MISS_COUNT
258-
u32 numitlb, numdtlb, num_pte_not_present;
259-
260-
static int fill_display_data(char *kbuf)
261-
{
262-
size_t num = 0;
263-
num += sprintf(kbuf + num, "I-TLB Miss %x\n", numitlb);
264-
num += sprintf(kbuf + num, "D-TLB Miss %x\n", numdtlb);
265-
num += sprintf(kbuf + num, "PTE not present %x\n", num_pte_not_present);
266-
267-
if (clr_on_read)
268-
numitlb = numdtlb = num_pte_not_present = 0;
269-
270-
return num;
271-
}
272-
273-
static int tlb_stats_open(struct inode *inode, struct file *file)
274-
{
275-
file->private_data = (void *)__get_free_page(GFP_KERNEL);
276-
return 0;
277-
}
278-
279-
/* called on user read(): display the counters */
280-
static ssize_t tlb_stats_output(struct file *file, /* file descriptor */
281-
char __user *user_buf, /* user buffer */
282-
size_t len, /* length of buffer */
283-
loff_t *offset) /* offset in the file */
284-
{
285-
size_t num;
286-
char *kbuf = (char *)file->private_data;
287-
288-
/* All of the data can he shoved in one iteration */
289-
if (*offset != 0)
290-
return 0;
291-
292-
num = fill_display_data(kbuf);
293-
294-
/* simple_read_from_buffer() is helper for copy to user space
295-
It copies up to @2 (num) bytes from kernel buffer @4 (kbuf) at offset
296-
@3 (offset) into the user space address starting at @1 (user_buf).
297-
@5 (len) is max size of user buffer
298-
*/
299-
return simple_read_from_buffer(user_buf, num, offset, kbuf, len);
300-
}
301-
302-
/* called on user write : clears the counters */
303-
static ssize_t tlb_stats_clear(struct file *file, const char __user *user_buf,
304-
size_t length, loff_t *offset)
305-
{
306-
numitlb = numdtlb = num_pte_not_present = 0;
307-
return length;
308-
}
309-
310-
static int tlb_stats_close(struct inode *inode, struct file *file)
311-
{
312-
free_page((unsigned long)(file->private_data));
313-
return 0;
314-
}
315-
316-
static const struct file_operations tlb_stats_file_ops = {
317-
.read = tlb_stats_output,
318-
.write = tlb_stats_clear,
319-
.open = tlb_stats_open,
320-
.release = tlb_stats_close
321-
};
322-
#endif
323-
324-
static int __init arc_debugfs_init(void)
325-
{
326-
test_dir = debugfs_create_dir("arc", NULL);
327-
328-
#ifdef CONFIG_ARC_DBG_TLB_MISS_COUNT
329-
test_dentry = debugfs_create_file("tlb_stats", 0444, test_dir, NULL,
330-
&tlb_stats_file_ops);
331-
#endif
332-
333-
test_u32_dentry =
334-
debugfs_create_u32("clr_on_read", 0444, test_dir, &clr_on_read);
335-
336-
return 0;
337-
}
338-
339-
module_init(arc_debugfs_init);
340-
341-
static void __exit arc_debugfs_exit(void)
342-
{
343-
debugfs_remove(test_u32_dentry);
344-
debugfs_remove(test_dentry);
345-
debugfs_remove(test_dir);
346-
}
347-
module_exit(arc_debugfs_exit);
348-
349-
#endif

‎arch/arc/mm/tlbex.S‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,6 @@ ex_saved_reg1:
237237

238238
2:
239239

240-
#ifdef CONFIG_ARC_DBG_TLB_MISS_COUNT
241-
and.f 0, r0, _PAGE_PRESENT
242-
bz 1f
243-
ld r3, [num_pte_not_present]
244-
add r3, r3, 1
245-
st r3, [num_pte_not_present]
246-
1:
247-
#endif
248-
249240
.endm
250241

251242
;-----------------------------------------------------------------
@@ -309,12 +300,6 @@ ENTRY(EV_TLBMissI)
309300

310301
TLBMISS_FREEUP_REGS
311302

312-
#ifdef CONFIG_ARC_DBG_TLB_MISS_COUNT
313-
ld r0, [@numitlb]
314-
add r0, r0, 1
315-
st r0, [@numitlb]
316-
#endif
317-
318303
;----------------------------------------------------------------
319304
; Get the PTE corresponding to V-addr accessed, r2 is setup with EFA
320305
LOAD_FAULT_PTE
@@ -349,12 +334,6 @@ ENTRY(EV_TLBMissD)
349334

350335
TLBMISS_FREEUP_REGS
351336

352-
#ifdef CONFIG_ARC_DBG_TLB_MISS_COUNT
353-
ld r0, [@numdtlb]
354-
add r0, r0, 1
355-
st r0, [@numdtlb]
356-
#endif
357-
358337
;----------------------------------------------------------------
359338
; Get the PTE corresponding to V-addr accessed
360339
; If PTE exists, it will setup, r0 = PTE, r1 = Ptr to PTE, r2 = EFA

0 commit comments

Comments
 (0)