----- Original Message -----
From: "Kazuhito Hagio" <khagio(a)redhat.com>
To: kexec(a)lists.fedoraproject.org
Sent: Thursday, May 24, 2018 12:31:28 AM
Subject: Re: [PATCHv2] kdumpctl: add showmem cmd
Hi,
I can find this patch in the git tree, but it doesn't work well.
[root@fedora ~]# cat /sys/kernel/kexec_crash_size
268435456
[root@fedora ~]# kdumpctl showmem
expr: non-integer argument
Reserved 3DMB memory for crash kernel
It has extra "3D" strings.
Oh, it seems that my tools has some problem during the copy and paste.
Will fix it,
Thanks
> Thanks,
> Kazu
>
> On 5/17/2018 11:27 PM, Dave Young wrote:
> > On 05/18/18 at 10:17am, piliu wrote:
> >>
> >>
> >> On 05/15/2018 01:12 PM, Bhupesh Sharma wrote:
> >>> Hello Pingfan,
> >>>
> >>> On Fri, May 11, 2018 at 7:32 AM, Pingfan Liu <piliu(a)redhat.com>
wrote:
> >>>> port from rhel, original patch is contributed by Minfei Huang:
> >>>
> >>> Hmm, do we need to add Minfei's credentials as Suggested-by?
> >>>
> >> Do not know how to handle it. Had no way to communicate with Minfei.
> >> Hence just doc like this.
> >
> > A thing is in Fedora there is no crashkernel=auto, so the below
> > paragraph can be dropped.
> >
> > I can fix this along with adding Minfei's credential.
> >
> >>>> If the grub kernel commandline is set to crashkernel=auto, it will
not
> >>>> expand the crashkernel=auto in the /proc/cmdline. It still says
> >>>> crashkernel=auto.
> >>>>
> >>>> Using /sys to determines crashkernel actual size is confusing since
> >>>> there is no unit of measure.
> >>>>
> >>>> Add a new command "kdumpctl showmem" to show the reserved
memory kindly.
> >>>>
> >>>> Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
> >>>> ---
> >>>> kdumpctl | 13 ++++++++++++-
> >>>> kdumpctl.8 | 3 +++
> >>>> 2 files changed, 15 insertions(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/kdumpctl b/kdumpctl
> >>>> index cebca36..1279d72 100755
> >>>> --- a/kdumpctl
> >>>> +++ b/kdumpctl
> >>>> @@ -830,6 +830,14 @@ propagate_ssh_key()
> >>>> fi
> >>>> }
> >>>>
> >>>> +show_reserved_mem()
> >>>> +{
> >>>> + local mem=3D$(cat /sys/kernel/kexec_crash_size)
> >>>> + local mem_mb=3D$(expr $mem / 1024 / 1024)
> >>>> +
> >>>> + echo "Reserved "$mem_mb"MB memory for crash
kernel"
> >>>> +}
> >>>> +
> >>>> handle_mode_switch()
> >>>> {
> >>>> if [ "$DEFAULT_DUMP_MODE" == "fadump" ];
then
> >>>> @@ -1246,8 +1254,11 @@ main ()
> >>>> propagate)
> >>>> propagate_ssh_key
> >>>> ;;
> >>>> + showmem)
> >>>> + show_reserved_mem
> >>>> + ;;
> >>>> *)
> >>>> - echo $"Usage: $0
{start|stop|status|restart|propagate}"
> >>>> + echo $"Usage: $0
> >>>> {start|stop|status|restart|propagate|showmem}"
> >>>> exit 1
> >>>> esac
> >>>> }
> >>>> diff --git a/kdumpctl.8 b/kdumpctl.8
> >>>> index b446b81..023562b 100644
> >>>> --- a/kdumpctl.8
> >>>> +++ b/kdumpctl.8
> >>>> @@ -35,6 +35,9 @@ Is equal to
> >>>> .I propagate
> >>>> Helps to setup key authentication for ssh storage since it's
> >>>> impossible to use password authentication during kdump.
> >>>> +.TP
> >>>> +.I showmem
> >>>> +Prints the size of reserved memory for crash kernel in megabytes.
> >>>>
> >>>> .SH "SEE ALSO"
> >>>> .BR kdump.conf (5),
> >>>> --
> >>>> 2.7.4
> >>>>
> >>>
> >>> Otherwise, looks ok to me:
> >>>
> >>> Acked-by: Bhupesh Sharma <bhsharma(a)redhat.com>
> >>>
> >>> Thanks,
> >>> Bhupesh
> >>> _______________________________________________
> >>> kexec mailing list -- kexec(a)lists.fedoraproject.org
> >>> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> >>>
> >> _______________________________________________
> >> kexec mailing list -- kexec(a)lists.fedoraproject.org
> >> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> >> Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
> >> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> >> List Archives:
> >>
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.o...
> >
> > Thanks
> > Dave
> > _______________________________________________
> > kexec mailing list -- kexec(a)lists.fedoraproject.org
> > To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> > Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
> > List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> > List Archives:
> >
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.o...
> >
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://getfedora.org/code-of-conduct.html
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
>
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.o...
>