xref: /aosp_15_r20/external/trace-cmd/CONTRIBUTE (revision 58e6ee5f017f6a8912852c892d18457e4bafb554)
1*58e6ee5fSAndroid Build Coastguard WorkerIf you like to become part of the community and submit patches, here's how
2*58e6ee5fSAndroid Build Coastguard Workerto do so for trace-cmd.
3*58e6ee5fSAndroid Build Coastguard Worker
4*58e6ee5fSAndroid Build Coastguard WorkerIf you only want to report a bug, or suggest an enhancement, you may do
5*58e6ee5fSAndroid Build Coastguard Workerso at:
6*58e6ee5fSAndroid Build Coastguard Worker
7*58e6ee5fSAndroid Build Coastguard Worker  https://bugzilla.kernel.org/buglist.cgi?component=Trace-cmd%2FKernelshark
8*58e6ee5fSAndroid Build Coastguard Worker
9*58e6ee5fSAndroid Build Coastguard WorkerAll development is done via a mailing list:
10*58e6ee5fSAndroid Build Coastguard Worker
11*58e6ee5fSAndroid Build Coastguard Worker   http://vger.kernel.org/vger-lists.html#linux-trace-devel
12*58e6ee5fSAndroid Build Coastguard Worker
13*58e6ee5fSAndroid Build Coastguard WorkerPatches should be sent to [email protected]
14*58e6ee5fSAndroid Build Coastguard Worker
15*58e6ee5fSAndroid Build Coastguard WorkerStart by cloning the official repository:
16*58e6ee5fSAndroid Build Coastguard Worker
17*58e6ee5fSAndroid Build Coastguard Worker  git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git
18*58e6ee5fSAndroid Build Coastguard Worker
19*58e6ee5fSAndroid Build Coastguard WorkerMake your changes. When you are satisfied with them, commit them into git.
20*58e6ee5fSAndroid Build Coastguard WorkerHere's some helpful hints for your git commits.
21*58e6ee5fSAndroid Build Coastguard Worker
22*58e6ee5fSAndroid Build Coastguard Worker1) When making changes, please follow the coding style defined by the file
23*58e6ee5fSAndroid Build Coastguard Worker   called CODING_STYLE in this directory.
24*58e6ee5fSAndroid Build Coastguard Worker
25*58e6ee5fSAndroid Build Coastguard Worker2) Every commit should only do one thing.
26*58e6ee5fSAndroid Build Coastguard Worker   That is, if your work requires some cleaning up of code, do that
27*58e6ee5fSAndroid Build Coastguard Worker   clean up as a separate commit and not with your functional changes.
28*58e6ee5fSAndroid Build Coastguard Worker   Find ways to take "steps" in modifying code. If you can break up
29*58e6ee5fSAndroid Build Coastguard Worker   your changes in a series of steps, do so.
30*58e6ee5fSAndroid Build Coastguard Worker
31*58e6ee5fSAndroid Build Coastguard Worker3) The commit log should start with a title. Like the below
32*58e6ee5fSAndroid Build Coastguard Worker
33*58e6ee5fSAndroid Build Coastguard Worker      trace-cmd: Add CONTRIBUTE file
34*58e6ee5fSAndroid Build Coastguard Worker
35*58e6ee5fSAndroid Build Coastguard Worker   Even though this repo is for trace-cmd, start the topic with
36*58e6ee5fSAndroid Build Coastguard Worker   "trace-cmd:" because the commits will end up as patches to a mailing
37*58e6ee5fSAndroid Build Coastguard Worker   list that handles other tracing repos, differentiating them with the subject
38*58e6ee5fSAndroid Build Coastguard Worker   is useful. You can be more specific as well. If the change only affects the
39*58e6ee5fSAndroid Build Coastguard Worker   "record" command, you may start the title with "trace-cmd record:".
40*58e6ee5fSAndroid Build Coastguard Worker
41*58e6ee5fSAndroid Build Coastguard Worker4) The body of the commit (with a blank line from the title), should be self
42*58e6ee5fSAndroid Build Coastguard Worker   contained, and explain why you are making the change. The title should hold
43*58e6ee5fSAndroid Build Coastguard Worker   the "what" is changing, but the body contains the rationale for the change.
44*58e6ee5fSAndroid Build Coastguard Worker   It should be a stand alone, and not state things like "See the next patch",
45*58e6ee5fSAndroid Build Coastguard Worker   because when it is in git history, there's no knowing what the next patch
46*58e6ee5fSAndroid Build Coastguard Worker   is.  You can make statements like "This is needed for a <future-feature>
47*58e6ee5fSAndroid Build Coastguard Worker   that will come later". Where "<future-feature>" is something that you are
48*58e6ee5fSAndroid Build Coastguard Worker   working on and the current commit is one of the steps required to get there.
49*58e6ee5fSAndroid Build Coastguard Worker
50*58e6ee5fSAndroid Build Coastguard Worker5) Add your Developer Certificate of Origin (DCO) at the bottom of the commit
51*58e6ee5fSAndroid Build Coastguard Worker   log. That is "Signed-off-by: Full Name <email>" where your full name is your
52*58e6ee5fSAndroid Build Coastguard Worker   real name (no pseudonyms). Optionally, if you are making the change on
53*58e6ee5fSAndroid Build Coastguard Worker   behalf of your company, you may also add your company name, if you are not
54*58e6ee5fSAndroid Build Coastguard Worker   using your company's email. "Signed-off-by: Full Name (Company) <email>".
55*58e6ee5fSAndroid Build Coastguard Worker   Please note, the DCO is your statement that you have the legal right to
56*58e6ee5fSAndroid Build Coastguard Worker   make these changes for the project you are submitting to.
57*58e6ee5fSAndroid Build Coastguard Worker
58*58e6ee5fSAndroid Build Coastguard WorkerYou can use the Linux kernel "checkpatch.pl" script to help verify the formatting
59*58e6ee5fSAndroid Build Coastguard Workerof your patch:
60*58e6ee5fSAndroid Build Coastguard Worker
61*58e6ee5fSAndroid Build Coastguard Worker  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl
62*58e6ee5fSAndroid Build Coastguard Worker
63*58e6ee5fSAndroid Build Coastguard WorkerPlease note that checkpatch.pl is a guide and not a hard rule. If it reports a
64*58e6ee5fSAndroid Build Coastguard Workerfix that makes the code harder to read, that fix can probably be ignored.
65*58e6ee5fSAndroid Build Coastguard Worker
66*58e6ee5fSAndroid Build Coastguard Worker  git format-patch --stdout HEAD~1..HEAD | ./checkpatch.pl
67*58e6ee5fSAndroid Build Coastguard Worker
68*58e6ee5fSAndroid Build Coastguard WorkerFinally, you can use the git "send-email" functionality:
69*58e6ee5fSAndroid Build Coastguard Worker
70*58e6ee5fSAndroid Build Coastguard Worker  git send-email --from='<your-email> --to='[email protected]' HEAD~1..HEAD
71*58e6ee5fSAndroid Build Coastguard Worker
72*58e6ee5fSAndroid Build Coastguard WorkerIf you are sending one patch, if you are adding more than one patch, also include
73*58e6ee5fSAndroid Build Coastguard Workera cover letter:
74*58e6ee5fSAndroid Build Coastguard Worker
75*58e6ee5fSAndroid Build Coastguard Worker  git send-email --cover-letter --annotate --from='<your-email> --to='[email protected]' <first-commit>~1..HEAD
76*58e6ee5fSAndroid Build Coastguard Worker
77*58e6ee5fSAndroid Build Coastguard WorkerIf you receive feedback on your patches, and plan on sending another version,
78*58e6ee5fSAndroid Build Coastguard Workerplease use the '-v' option to mark your patches that they are a new version.
79*58e6ee5fSAndroid Build Coastguard WorkerFor example, if you add "-v2" to the above commands, instead of having:
80*58e6ee5fSAndroid Build Coastguard Worker"[PATCH]" in the subject, it will have "[PATCH v2]", letting the reviewers know
81*58e6ee5fSAndroid Build Coastguard Workerthat this is a new version. If you send another version, use "-v3" and so on.
82*58e6ee5fSAndroid Build Coastguard Worker
83*58e6ee5fSAndroid Build Coastguard WorkerFor more information about git send-email:
84*58e6ee5fSAndroid Build Coastguard Worker
85*58e6ee5fSAndroid Build Coastguard Worker  https://git-scm.com/docs/git-send-email
86*58e6ee5fSAndroid Build Coastguard Worker
87*58e6ee5fSAndroid Build Coastguard WorkerTo keep track of the status of patches that have been submitted, check out:
88*58e6ee5fSAndroid Build Coastguard Worker
89*58e6ee5fSAndroid Build Coastguard Worker  https://patchwork.kernel.org/project/linux-trace-devel/list/
90*58e6ee5fSAndroid Build Coastguard Worker
91*58e6ee5fSAndroid Build Coastguard WorkerIf you would like to apply patches from the mailing list, you can use
92*58e6ee5fSAndroid Build Coastguard Workerthe "b4" utility.
93*58e6ee5fSAndroid Build Coastguard Worker
94*58e6ee5fSAndroid Build Coastguard Worker $ pip install b4
95*58e6ee5fSAndroid Build Coastguard Worker
96*58e6ee5fSAndroid Build Coastguard WorkerThen from the mailing list archive, find a message id from a patch or patch
97*58e6ee5fSAndroid Build Coastguard Workerseries. For example, to get the patch from:
98*58e6ee5fSAndroid Build Coastguard Worker
99*58e6ee5fSAndroid Build Coastguard Worker  https://lore.kernel.org/linux-trace-devel/[email protected]/
100*58e6ee5fSAndroid Build Coastguard Worker
101*58e6ee5fSAndroid Build Coastguard Worker $ b4 am -o - [email protected] > /tmp/p.mbox
102*58e6ee5fSAndroid Build Coastguard Worker $ git am /tmp/p.mbox
103*58e6ee5fSAndroid Build Coastguard Worker
104