Re: [PATCH v4 19/39] unwind_user/sframe: Add support for reading .sframe contents

Josh Poimboeuf <[email protected]>
Newsgroups org.kernel.vger.linux-toolchains,org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-trace-kernel
Message-ID <20250204183847.mr2dnge55simbmkl@jpoimboe>
On Thu, Jan 30, 2025 at 07:07:32AM -0800, Indu Bhagat wrote:
> On 1/21/25 6:31 PM, Josh Poimboeuf wrote:
> > +	for (i = 0; i < fde->fres_num; i++) {
> > +		int ret;
> > +
> > +		/*
> > +		 * Alternate between the two fre_addr[] entries for 'fre' and
> > +		 * 'prev_fre'.
> > +		 */
> > +		fre = which ? fres : fres + 1;
> > +		which = !which;
> > +
> > +		ret = __read_fre(sec, fde, fre_addr, fre);
> > +		if (ret)
> > +			return ret;
> > +
> 
> It should be possible to only read the ip_off and info from FRE and defer
> the reading of offsets (as done in __read_fre) until later when you do need
> the offsets. See below.
> 
> We can find the relevant FRE with the following pieces of information:
>   - ip_off
>   - fre_size (this will mean we need to read the uin8_t info in the FRE)

Indeed, I'll skip reading the offsets until after the loop.

-- 
Josh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.