mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-05 20:53:04 +09:00
PD#SWPL-6028 Problem: enable ftrce in ramoops for new tm2 dtbs Solution: enable ftrce in ramoops for new tm2 dtbs Verify: verified ok Change-Id: Ia7ee3b11784a69ef7d6b7671f9ad75c14ae477f7 Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> Signed-off-by: Luan Yuan <luan.yuan@amlogic.com> debug: improve ftrace_ramoops for io trace [2/2] PD#SWPL-6028 Problem: improve ftrace_ramoops to debug bus hang Solution: 1. in uboot setenv initargs $initargs ramoops_io_en=1 loglevel=3;save;reset 2. in linux command line: cat /sys/module/kernel/parameters/ramoops_io_en to check if success. 3. after watchdog reboot, get trace data with: cat /sys/fs/pstore/ftrace-ramoops-0 Verify: TL1 x301 Change-Id: If1a2582b40a3ded31eedef5355eb0b8a5bf495c3 Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> debug: save irqflag locally when ftrace_ramoops io [1/1] PD#SWPL-6028 Problem: save irqflag locally when ftrace_ramoops io Solution: save irqflag locally when ftrace_ramoops io Verify: TL1 x301 Change-Id: I6df9700cceaccc97dc983d88ada73197a6968f73 Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> debug: do not print old_size when ftrace_size is 0 [1/1] PD#SWPL-6028 Problem: do not print old_size when ftrace_size is 0 Solution: do not print old_size when ftrace_size is 0 Verify: TL1 x301 Change-Id: I00a71c83fede14a2606c5e7eea5d8c4fdaeb5553 Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com> dts: change ftrace-size. [1/1] PD#SWPL-6028 Problem: add ftrace-size. Solution: add ftrace-size. Verify: no. Change-Id: I42d34edf665632dfe29d04df192964238b8e3df8 Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com> Signed-off-by: Luan Yuan <luan.yuan@amlogic.com>
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
#ifndef __PSTORE_INTERNAL_H__
|
|
#define __PSTORE_INTERNAL_H__
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/time.h>
|
|
#include <linux/pstore.h>
|
|
|
|
#if NR_CPUS <= 2 && defined(CONFIG_ARM_THUMB)
|
|
#define PSTORE_CPU_IN_IP 0x1
|
|
#elif NR_CPUS <= 4 && defined(CONFIG_ARM)
|
|
#define PSTORE_CPU_IN_IP 0x3
|
|
#endif
|
|
|
|
struct pstore_ftrace_record {
|
|
unsigned long ip;
|
|
unsigned long parent_ip;
|
|
#ifndef PSTORE_CPU_IN_IP
|
|
unsigned int cpu;
|
|
#endif
|
|
#ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
|
|
int pid;
|
|
unsigned long val1;
|
|
unsigned long val2;
|
|
unsigned long long time;
|
|
unsigned char comm[8];
|
|
unsigned int flag;
|
|
#endif
|
|
};
|
|
|
|
#ifdef CONFIG_AMLOGIC_DEBUG_FTRACE_PSTORE
|
|
void notrace pstore_ftrace_save(struct pstore_ftrace_record *rec);
|
|
void notrace pstore_ftrace_dump(struct pstore_ftrace_record *rec,
|
|
struct seq_file *s);
|
|
#endif
|
|
|
|
static inline void
|
|
pstore_ftrace_encode_cpu(struct pstore_ftrace_record *rec, unsigned int cpu)
|
|
{
|
|
#ifndef PSTORE_CPU_IN_IP
|
|
rec->cpu = cpu;
|
|
#else
|
|
rec->ip |= cpu;
|
|
#endif
|
|
}
|
|
|
|
static inline unsigned int
|
|
pstore_ftrace_decode_cpu(struct pstore_ftrace_record *rec)
|
|
{
|
|
#ifndef PSTORE_CPU_IN_IP
|
|
return rec->cpu;
|
|
#else
|
|
return rec->ip & PSTORE_CPU_IN_IP;
|
|
#endif
|
|
}
|
|
|
|
#ifdef CONFIG_PSTORE_FTRACE
|
|
extern void pstore_register_ftrace(void);
|
|
extern void pstore_unregister_ftrace(void);
|
|
#else
|
|
static inline void pstore_register_ftrace(void) {}
|
|
static inline void pstore_unregister_ftrace(void) {}
|
|
#endif
|
|
|
|
#ifdef CONFIG_PSTORE_PMSG
|
|
extern void pstore_register_pmsg(void);
|
|
extern void pstore_unregister_pmsg(void);
|
|
#else
|
|
static inline void pstore_register_pmsg(void) {}
|
|
static inline void pstore_unregister_pmsg(void) {}
|
|
#endif
|
|
|
|
extern struct pstore_info *psinfo;
|
|
|
|
extern void pstore_set_kmsg_bytes(int);
|
|
extern void pstore_get_records(int);
|
|
extern int pstore_mkfile(enum pstore_type_id, char *psname, u64 id,
|
|
int count, char *data, bool compressed,
|
|
size_t size, struct timespec time,
|
|
struct pstore_info *psi);
|
|
extern bool pstore_is_mounted(void);
|
|
|
|
#endif
|