1. 1

    Great to see this! Are you planning to send a PR so this gets merged into upstream?

    1. 4

      It is already merged into upstream, thanks! :-)

      1. 1

        Yeah they were very responsive when I was upstreaming Fuchsia compatibility.

    1. 5

      This is a nice effort, but one wonders why the author doesn’t want to use vmstat(8).

      Side note: The author doesn’t seem to be too familiar with OpenBSD and its conventions. The man page was written in man(7), which is deprecated in favor of mdoc(7) on OpenBSD

      1. 3

        Thanks for educating me about the distinction: https://github.com/blinkkin/blinkkin.github.com/wiki/man-vs-mdoc

        1. 4

          I’d suggest Practical UNIX Manuals for introductionary reading for mdoc, too: https://manpages.bsd.lv/mdoc.html

        2. 3

          Thanks very much for your pointing out to use mdoc!

          Compared to vmstat(8), my simple toy has following differences:
          (1) Add displaying swap space;
          (2) Only consider active pages as “used” memory, others are all counted as “free” memory.IMHO, for the end user who doesn’t care the guts of Operating System, maybe this method is more plausible?

          All in all, I just write a small tool for fun, and thanks very much again for giving pertinent advice!

          1. 2

            Agreed. Sometimes you don’t really care about everything vmstat offers. free is dirty neat :)

            • TIL about mdoc
            1. 1

              P.S. After some testing, I modify the calculating free method just now: use free pages as “free” memory, then others are considered as “used” memory.

          1. 2

            Next Year in Christchurch New Zealand! https://twitter.com/linuxconfau2019

            I look forward to welcoming you in person!

            1. 1

              New Zealand is a beautiful country. Hope I can get the opportunity to take part in linuxconfau2019.

              1. 1

                While I’m sure there will be some activities associated with the conference, there is a lot more to see and do.

                So if you do come, take a bit of vacation leave after the conf so you can do a few trips into the mountains or to the beaches.

            1. 2

              Not really a lot of meat here. @nanxiao, I’m not sure if English is your first language but “cautious” is not really the right word to use here. This post is just describe some rules of the language, there isn’t much caution to be had. Perhaps “Be aware …” would be a slightly better title.

              1. 1

                @apy Got it! Thanks for your comments!

              1. 2

                Is it just me, or is the page only using half of the screen width, making it quite hard to read o a mobile device?

                1. 2

                  It’s not just you.

                  1. 2

                    I fix the theme, thanks!

                    1. 1

                      thanks, much better now

                  1. 1

                    You mentioned missing some talks. Is there any official way to watch videos of all the presentations? It’d be nice to see them all recorded and posted as a playlist on YouTube, perhaps in their official channel. I looked around but can’t find a collection of them.

                    1. 1

                      I think this is the official youtube channel: https://www.youtube.com/user/CppCon/playlists. It seems the videos for CppCon 2017 are still being uploaded.

                      1. 1

                        Thanks. I’ll check again in a week and maybe they will be complete.

                    1. 1

                      Ran on macOS just to see what happens:

                      Architecture:            x86_64
                      Byte Order:              Little Endian
                      Total CPU(s):            4
                      Model name:              MacBookPro11,1
                      

                      I appreciate graceful degradation!

                      1. 1

                        I update the code, so it can run on macOS now:-). When you have time, you can try it, thanks!

                      1. 2

                        Works as intended for me on Intel Pentium and Xeons with FreeBSD.

                        Feature request: also show frequencies (min, max, current).

                        1. 1

                          Both OpenBSD and FreeBSD’ sysctl(3) interface lack mib code to get frequencies. CPUID instruction can’t take effect. So I need to consider other methods, thanks for your feedback!