RE: Should Pstore(ramoops) records customized information?

From: Luck, Tony
Date: Wed Jun 18 2014 - 13:50:51 EST


> (1) The backend (ramoops) provides servel memory regions staticly. Each region
> is a ring buffer, which does not connect with certain PSTORE_TYPE_ID. So no one
> can modify or use it before allocation.
>
> (2) A pstore user allocs a memory region, pstore will return a pstore_type_id.
>
> pstore_type_id = alloc_pstroe_region()
>
> (3) This user record certain message to this region.
>
> psinfo->write(pstore_type_id, ...)

Don't you need to match up the number of back-end ring buffer regions
with the number of users in the kernel that call alloc_pstore_region()?

Or do you envision that the backend can create these regions on demand?

Would different users need different sized regions? I think logging of
console messages might be able to work with a smaller ring buffer
than the ftrace logger. So perhaps we need a "size" argument when allocating?

Since these "regions" are in fact "ring buffers", the name of the allocation
routine should make that clear. So call it "pstore_alloc_ring_buffer()"

After the system hangs/crashes ... how would you like pstore to
name these objects in /sys/fs/pstore/ for applications to pick them
up for analysis? Maybe pstore_alloc_ring_buffer() needs a "char *name"
argument as well as a size?

-Tony
N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå