On Sat, 16 Oct 2021 at 01:17, Vladimir Oltean <olte...@gmail.com> wrote:
> On Fri, Oct 15, 2021 at 10:48:28PM +0000, Geva, Erez wrote: > > Regarding the "ugly scripting" of pmc. > > > > I create the http://libpmc.sf.net/ just to work around this issue. > > > > The libpmc provides a library with pmc tool capabilities, and wrapper > for scripting as Python, Lua and Perl. > > Is there an option to use C? I don't see it. I don't know anything other > than C, nor do I have the time to learn right now or in the foreseeable > future. > The library is C++. You do not need to know C++, you just need to use the proper classes. Look on pmc.cpp. It uses C++, but it does not have any classes in it. So you can say it is a "dirty" C. I thought of adding a pure C wrapping. But as this is a huge task, and as the libpmc follows the embedded C++ guidelines, I decided to stick to C++. If you see any issue regarding embedded C++, please notify and I will comply. > > > I think pmc is as a testing tool for the linuxptp project, but not a > real tool for users. > > I can agree with that. > > > The libpmc also comes with a compatible pmc tool that runs much faster > then the original. > > But equally useless from a functionality perspective, as per above. > I wrote the pmc tool more as a test for the libpmc library. You can use the tool directly or use it as an example to write your application with the libpmc library. > > Although, I am not oppose your patch. I just find it useless, as I > perform the same result in a Perl script. > > Here you're wrong, you can't do NOTIFY_TIME_SYNC remotely either, since > the remote ptp4l denies that. It may be something you don't need, but > that doesn't make it all useless. > The libpmc provides pmc tool functionality, including the NOTIFY_TIME_SYNC. As the libpmc project is a code. It could have bugs or missing features. So like any project. We can fix them and add new features. I started with the pmc tool. But I am open to more. Including adding active members to the project. I do see the project as my contribution to the community, and I do like to share it :-) > > And with a much higher flexibility and a better performance. > > I actually don't need flexibility/feature bloat, I want a simple tool > for a simple task. And I use this on embedded systems where I don't > have Lua, Perl, Python, Ruby, etc etc. I'm actually completely fine with > I use Lua on a 100 MB flash disk controller, running embedded Linux. Some people stick to the "old" C only approach. I do write my real time code in C and improve embedded C++. But for non-real time management code, why should I work so much and gain so little? Do you plan to replace all of your system scripts with C applications? > the API exposed by pmc_agent.c. And the resulting program is so small > that I don't think I have a huge problem with maintaining it myself if > no other self-contained solution comes along. > > Only, it is not a real API. pmc_agent.c is not a library, and you can not integrate it with your project. You can only add code to the linuxptp project. You might need this one application, but you are not alone. I also write a TSN application, and my customer might ask for more. In addition to the "sync" application, I also need an application for "path" delay (path length). Do you think we should add all of the production applications to the linuxptp project? And how do you use the "sync" application without a script? We end up with ugly bash scripts to "glue" the linuxptp to our application. I suggest integrating libpmc directly in your application. > Also, better performance relative to what? > > I compare the linuxptp pmc tool to the libpmc pmc tool. See the "testing.sh" script. I am talking about a factor of up to 100 times faster. I use the Perl wrapper of the libpmc in my application and saw a huge improvement compared to using the pmc tool with the system API. > > You can use the libpmc, to write a tool like that in the script language > you like. > > And submit it as an example in the libpmc project. > > > > Enjoy > > Erez > > Erez > > _______________________________________________ > Linuxptp-devel mailing list > Linuxptp-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linuxptp-devel >
_______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel