Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07f80d41 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pstore update from Tony Luck:
 "Miscellaneous fs/pstore fixes"

* tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
  pstore: Fix sprintf format specifier in pstore_dump()
  pstore: Add pmsg - user-space accessible pstore object
  pstore: Handle zero-sized prz in series
  pstore: Remove superfluous memory size check
  pstore: Use scnprintf() in pstore_mkfile()
parents 6f83e5bd a6b8978c
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,16 @@ config PSTORE_CONSOLE
	  When the option is enabled, pstore will log all kernel
	  When the option is enabled, pstore will log all kernel
	  messages, even if no oops or panic happened.
	  messages, even if no oops or panic happened.


config PSTORE_PMSG
	bool "Log user space messages"
	depends on PSTORE
	help
	  When the option is enabled, pstore will export a character
	  interface /dev/pmsg0 to log user space messages. On reboot
	  data can be retrieved from /sys/fs/pstore/pmsg-ramoops-[ID].

	  If unsure, say N.

config PSTORE_FTRACE
config PSTORE_FTRACE
	bool "Persistent function tracer"
	bool "Persistent function tracer"
	depends on PSTORE
	depends on PSTORE
+2 −0
Original line number Original line Diff line number Diff line
@@ -7,5 +7,7 @@ obj-y += pstore.o
pstore-objs += inode.o platform.o
pstore-objs += inode.o platform.o
obj-$(CONFIG_PSTORE_FTRACE)	+= ftrace.o
obj-$(CONFIG_PSTORE_FTRACE)	+= ftrace.o


obj-$(CONFIG_PSTORE_PMSG)	+= pmsg.o

ramoops-objs += ram.o ram_core.o
ramoops-objs += ram.o ram_core.o
obj-$(CONFIG_PSTORE_RAM)	+= ramoops.o
obj-$(CONFIG_PSTORE_RAM)	+= ramoops.o
+16 −10
Original line number Original line Diff line number Diff line
@@ -338,32 +338,38 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count,


	switch (type) {
	switch (type) {
	case PSTORE_TYPE_DMESG:
	case PSTORE_TYPE_DMESG:
		sprintf(name, "dmesg-%s-%lld%s", psname, id,
		scnprintf(name, sizeof(name), "dmesg-%s-%lld%s",
						compressed ? ".enc.z" : "");
			  psname, id, compressed ? ".enc.z" : "");
		break;
		break;
	case PSTORE_TYPE_CONSOLE:
	case PSTORE_TYPE_CONSOLE:
		sprintf(name, "console-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "console-%s-%lld", psname, id);
		break;
		break;
	case PSTORE_TYPE_FTRACE:
	case PSTORE_TYPE_FTRACE:
		sprintf(name, "ftrace-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "ftrace-%s-%lld", psname, id);
		break;
		break;
	case PSTORE_TYPE_MCE:
	case PSTORE_TYPE_MCE:
		sprintf(name, "mce-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "mce-%s-%lld", psname, id);
		break;
		break;
	case PSTORE_TYPE_PPC_RTAS:
	case PSTORE_TYPE_PPC_RTAS:
		sprintf(name, "rtas-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "rtas-%s-%lld", psname, id);
		break;
		break;
	case PSTORE_TYPE_PPC_OF:
	case PSTORE_TYPE_PPC_OF:
		sprintf(name, "powerpc-ofw-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "powerpc-ofw-%s-%lld",
			  psname, id);
		break;
		break;
	case PSTORE_TYPE_PPC_COMMON:
	case PSTORE_TYPE_PPC_COMMON:
		sprintf(name, "powerpc-common-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "powerpc-common-%s-%lld",
			  psname, id);
		break;
	case PSTORE_TYPE_PMSG:
		scnprintf(name, sizeof(name), "pmsg-%s-%lld", psname, id);
		break;
		break;
	case PSTORE_TYPE_UNKNOWN:
	case PSTORE_TYPE_UNKNOWN:
		sprintf(name, "unknown-%s-%lld", psname, id);
		scnprintf(name, sizeof(name), "unknown-%s-%lld", psname, id);
		break;
		break;
	default:
	default:
		sprintf(name, "type%d-%s-%lld", type, psname, id);
		scnprintf(name, sizeof(name), "type%d-%s-%lld",
			  type, psname, id);
		break;
		break;
	}
	}


+6 −0
Original line number Original line Diff line number Diff line
@@ -45,6 +45,12 @@ extern void pstore_register_ftrace(void);
static inline void pstore_register_ftrace(void) {}
static inline void pstore_register_ftrace(void) {}
#endif
#endif


#ifdef CONFIG_PSTORE_PMSG
extern void pstore_register_pmsg(void);
#else
static inline void pstore_register_pmsg(void) {}
#endif

extern struct pstore_info *psinfo;
extern struct pstore_info *psinfo;


extern void	pstore_set_kmsg_bytes(int);
extern void	pstore_set_kmsg_bytes(int);
+3 −2
Original line number Original line Diff line number Diff line
@@ -301,7 +301,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,


		if (big_oops_buf) {
		if (big_oops_buf) {
			dst = big_oops_buf;
			dst = big_oops_buf;
			hsize = sprintf(dst, "%s#%d Part%d\n", why,
			hsize = sprintf(dst, "%s#%d Part%u\n", why,
							oopscount, part);
							oopscount, part);
			size = big_oops_buf_sz - hsize;
			size = big_oops_buf_sz - hsize;


@@ -321,7 +321,7 @@ static void pstore_dump(struct kmsg_dumper *dumper,
			}
			}
		} else {
		} else {
			dst = psinfo->buf;
			dst = psinfo->buf;
			hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount,
			hsize = sprintf(dst, "%s#%d Part%u\n", why, oopscount,
									part);
									part);
			size = psinfo->bufsize - hsize;
			size = psinfo->bufsize - hsize;
			dst += hsize;
			dst += hsize;
@@ -447,6 +447,7 @@ int pstore_register(struct pstore_info *psi)
	if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) {
	if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) {
		pstore_register_console();
		pstore_register_console();
		pstore_register_ftrace();
		pstore_register_ftrace();
		pstore_register_pmsg();
	}
	}


	if (pstore_update_ms >= 0) {
	if (pstore_update_ms >= 0) {
Loading