[LUDOC-28] improve documentation examples for liblustreapi functions Created: 15/Dec/11 Updated: 10/May/13 Resolved: 10/May/13 |
|
| Status: | Closed |
| Project: | Lustre Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | Richard Henwood (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | QContent | ||
| Issue Links: |
|
||||||||||||||||
| Story Points: | 1 | ||||||||||||||||
| Business Value: | 23 | ||||||||||||||||
| Rank (Obsolete): | 7182 | ||||||||||||||||
| Description |
|
Per |
| Comments |
| Comment by Christopher Morrone [ 16/Dec/11 ] |
|
To be specific, the broken demo application is in section "34.6.Example Using the llapi Library". The first bug is here: printf("Lov object group %llu\n", lump->lmm_object_gr);
That structure has no lmm_object_gr member. And here is an obvious typo of a missing "p": rintf("Write to the file\n");
While someone is fixing it, they should really also make it easier to use. It would be nice if editing macros in the program was not necessary to run it. Also it would be nice to accept a path on the command line instead of assuming that the CWD is in a lustre filesystem without any checks to that effect. |
| Comment by Andreas Dilger [ 16/Dec/11 ] |
|
I made those changes last night after looking into this section of the manual for the first time. My only hesitation in submitting it directly is that I edited the program inside the manual and now it needs to be tested. |
| Comment by Andreas Dilger [ 16/Dec/11 ] |
|
http://review.whamcloud.com/1879 I haven't tested the example code yet, but posting it so it doesn't get lost. |
| Comment by Christopher Morrone [ 23/Jul/12 ] |
|
Also note that we'll need to update all of the man pages in lustre with the new examples as well. I would make a new LU ticket and link it to here, but I don't have linking ability as far as I can tell. I think we should probably make all of the examples be buildable .c files to start with. I have seen examples where C code was directly included into docbook documents using special directives. We should see if we can do that without too much effort. For now we'll probably just need to copy-and-paste the examples into the man pages. But perhaps in the future we'll put the manual in the Lustre tree, and let it build the man pages. Docbook defines a "reference page" type (<refentry>)that can be directly converted into man page format. |
| Comment by Andreas Dilger [ 23/Jul/12 ] |
|
I agree - having a subdirectory in the Lustre Git repo with all of the examples as .c files that are built every time would be the best way to ensure they continue to compile over time. Copying them into the manual occasionally is better than if they never get updated, and we can work on automating this process later, once we have examples that actually build and run. |
| Comment by Richard Henwood (Inactive) [ 23/Jul/12 ] |
|
For a first draft at a regression test against Chris's lustre/tests/clientapi/ I propose to put the examples from the manual in there. |
| Comment by Andreas Dilger [ 06/Aug/12 ] |
|
Assign to Richard, since he is mostly working on this. |
| Comment by Christopher Morrone [ 16/Nov/12 ] |
|
Richard, did you ever put the .c files somewhere? |
| Comment by Christopher Morrone [ 16/Nov/12 ] |
|
It might be better to use the <programlisting> docbook element for these program examples, instead of <screen>. |
| Comment by Richard Henwood (Inactive) [ 19/Nov/12 ] |
|
Indeed! thanks for the prompt: not only does <programlisting> look perfect for this, I've found a page on including external code examples to allow breaking out the programs to simplify testing: http://www.sagehill.net/docbookxsl/ExternalCode.html. Thanks for the prompt! |
| Comment by Richard Henwood (Inactive) [ 30/Nov/12 ] |
|
i've refreshed the code examples to work with the current master: |