Hi, Attached is the patch for new -flive-patching=[inline-only-static | inline-clone] master option. '-flive-patching=LEVEL' Control GCC's optimizations to provide a safe compilation for live-patching. Provides multiple-level control on how many of the optimizations are enabled by users' request. The LEVEL argument should be one of the following: 'inline-only-static' Only enable inlining of static functions, disable all other ipa optimizations/analyses. As a result, when patching a static routine, all its callers need to be patches as well. 'inline-clone' Only enable inlining and all optimizations that internally create clone, for example, cloning, ipa-sra, partial inlining, etc.; disable all other ipa optimizations/analyses. As a result, when patching a routine, all its callers and its clones' callers need to be patched as well. When -flive-patching specified without any value, the default value is "inline-clone". This flag is disabled by default. let me know your comments and suggestions on the implementation. thanks a lot. Qing
Attachment:
flive-patching.patch
Description: Binary data
> On Nov 12, 2018, at 4:29 PM, Qing Zhao <qing.zhao@xxxxxxxxxx> wrote: > > >> On Nov 12, 2018, at 2:53 AM, Martin Liška <mliska@xxxxxxx> wrote: >> >>> >>> Okay, I see. >>> >>> I am also working on a similar option as yours, but make the -flive-patching as two level control: >>> >>> +flive-patching >>> +Common RejectNegative Alias(flive-patching=,inline-clone) >>> + >>> +flive-patching= >>> +Common Report Joined RejectNegative Enum(live_patching_level) Var(flag_live_patching) Init(LIVE_NONE) >>> +-flive-patching=[inline-only-static|inline-clone] Control optimizations to provide a safe comp for live-patching purpose. >>> >>> the implementation for -flive-patching=inline-clone (the default) is exactly as yours, the new level -flive-patching=inline-only-static >>> is to only enable inlining of static function for live patching, which is important for multiple-processes live patching to control memory >>> consumption. >>> >>> (please see my 2nd version of the -flive-patching proposal). >>> >>> I will send out my complete patch in another email. >> >> Hi, sure, works for me. Let's make 2 level option. > > thank you. > > I will send the patch tomorrow. > > Qing >> >> Martin >