Estimating P in Amdahl’s Law theoretically and in practice

In parallel computing, Amdahl’s law is mainly used to predict the theoretical maximum speedup for program processing using multiple processors. If we denote the speed up by S then Amdahl’s is given by the formula :


where P is the proportion of a system or program that can be made parallel, and 1-P is the proportion that remains serial. My question is how can we compute or estimate P for a given program ?

More specifically, my question has two parts:

how can we compute P theoretically? how can we compute P in practice? I know my question could be easy but I am learning.

ref :