[Pdbg] [PATCH v2 03/12] libpdbg: Add api to get/dump ffdc data from sbefifo

Amitay Isaacs amitay at ozlabs.org
Thu Jul 11 15:35:05 AEST 2019


On Thu, 2019-07-11 at 15:29 +1000, Alistair Popple wrote:
> On Thursday, 11 July 2019 3:24:19 PM AEST Amitay Isaacs wrote:
> > On Thu, 2019-07-11 at 15:17 +1000, Alistair Popple wrote:
> > > Hi Amitay,
> > > 
> > > I'm not very familiar with the way FFDC data is passed from the
> > > kernel, so for
> > > my own education what is the difference between getting ffdc data
> > > and
> > > dumping
> > > ffdc data? Thanks.
> > 
> > ffdc_get() will give you the entire FFDC blob as received from SBE.
> > ffdc_dump() will try to parse the FFDC packages inside the blob and
> > dump them.
> > 
> > Any application linked against libpdbg, can get the FFDC data using
> > ffdc_get() and then parse that.
> > 
> > I am using ffdc_dump() to dump the FFDC packages inside FFDC blob
> > if
> > SBE chip-op fails when run as pdbg.  It's partial unpacking of FFDC
> > data.  This was my way of testing if the correct FFDC data is
> > received.
> > We can drop ffdc_dump() function altogether.
> 
> Oh I'm happy for it to be there if you think it makes sense for
> applications 
> to call it to read individual FFDC packages. If it's only for testing
> though 
> then perhaps we move it into a test?

Nah, trying to make the api work for individual FFDC packages is not
worth the effort.  I will just drop the ffdc_dump() function.  I can
keep the code around in case we need a test for it.

> 
> - Alistair
> 
> > Amitay.
> > 
> > > - Alistair
> > > 
> > > On Thursday, 4 July 2019 6:05:16 PM AEST Amitay Isaacs wrote:
> > > > Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> > > > ---
> > > > 
> > > >  libpdbg/libpdbg.h |  2 ++
> > > >  libpdbg/target.c  | 20 ++++++++++++++++++++
> > > >  2 files changed, 22 insertions(+)
> > > > 
> > > > diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
> > > > index 711c817..b9b271f 100644
> > > > --- a/libpdbg/libpdbg.h
> > > > +++ b/libpdbg/libpdbg.h
> > > > @@ -239,6 +239,8 @@ int opb_read(struct pdbg_target *target,
> > > > uint32_t addr,
> > > > uint32_t *data); int opb_write(struct pdbg_target *target,
> > > > uint32_t
> > > > addr,
> > > > uint32_t data);
> > > > 
> > > >  int sbe_istep(struct pdbg_target *target, uint32_t major,
> > > > uint32_t
> > > > 
> > > > minor);
> > > > +uint32_t sbe_ffdc_get(struct pdbg_target *target, const
> > > > uint8_t
> > > > **ffdc,
> > > > uint32_t *ffdc_len); +void sbe_ffdc_dump(struct pdbg_target
> > > > *target);
> > > > 
> > > >  typedef void (*pdbg_progress_tick_t)(uint64_t cur, uint64_t
> > > > end);
> > > > 
> > > > diff --git a/libpdbg/target.c b/libpdbg/target.c
> > > > index e193e7e..9495d61 100644
> > > > --- a/libpdbg/target.c
> > > > +++ b/libpdbg/target.c
> > > > @@ -275,6 +275,26 @@ int sbe_istep(struct pdbg_target *target,
> > > > uint32_t
> > > > major, uint32_t minor) return sbefifo->istep(sbefifo, major,
> > > > minor);
> > > > 
> > > >  }
> > > > 
> > > > +uint32_t sbe_ffdc_get(struct pdbg_target *target, const
> > > > uint8_t
> > > > **ffdc,
> > > > uint32_t *ffdc_len) +{
> > > > +	struct sbefifo *sbefifo;
> > > > +
> > > > +	assert(pdbg_target_is_class(target, "sbefifo"));
> > > > +
> > > > +	sbefifo = target_to_sbefifo(target);
> > > > +	return sbefifo->ffdc_get(sbefifo, ffdc, ffdc_len);
> > > > +}
> > > > +
> > > > +void sbe_ffdc_dump(struct pdbg_target *target)
> > > > +{
> > > > +	struct sbefifo *sbefifo;
> > > > +
> > > > +	assert(pdbg_target_is_class(target, "sbefifo"));
> > > > +
> > > > +	sbefifo = target_to_sbefifo(target);
> > > > +	sbefifo->ffdc_dump(sbefifo);
> > > > +}
> > > > +
> > > > 
> > > >  struct pdbg_target *require_target_parent(struct pdbg_target
> > > > 
> > > > *target)
> > > > 
> > > >  {
> > > >  
> > > >  	assert(target->parent);
> > 
> > Amitay.
> 
> 
> 

Amitay.
-- 

The trouble with being poor is that it takes up all your time.



More information about the Pdbg mailing list